Learn R Programming

drLumi (version 0.1.2)

intra_icc: Estimate ICC of a data.frame

Description

Given a data.frame in long format estimate ICC from the irr package

Usage

intra_icc(x, id.var = c("sample", "analyte"), value.var = "dil.fitted.conc", by = NULL, ...)

Arguments

x
a data.frame in long format with analyte, control number and concentration variables
id.var
one or more variables that identify each one of replicates samples
value.var
character vector with the name of the variable to estimate icc
by
character vector of the variable to stratify the icc results
...
arguments for the icc function from the irr package

Value

A list with three objects is returned:
  • icc.df, trasnformed data.frame in order to perform the icc analysis
  • icc.mod, the model output of the icc
  • icc.value, the icc value of the icc model

Details

The icc function is the one from the irr package.

See Also

irr

Examples

Run this code
# Generate data.frame
set.seed(123)
controls <- sort(paste("Control", rep(1:3,4),sep=""))
values <-  sort(unlist(lapply(1:12, function(x)runif(1,10+x,13+x))))
plateno <- rep(c("plate1","plate2"),6)
df <- data.frame(controls,values, plateno)
df <- df[order(df$plateno),]

# Estimate ICC
intra_icc(df, id.var = c("controls","plateno"),
value.var = "values", type="agreement",model="twoway", unit="single")
intra_icc(df, id.var = c("controls","plateno"),
value.var = "values", by = "plateno", type="agreement",model="twoway",
unit="single")

Run the code above in your browser using DataLab