r - Technical error of measurement (TEM) for 3 or more participants -
i need implement formula r function. surprise there no r packages tem function 3 or more participants. me out?
here go
# m : data frame of different measurements tem <- function(m) { nrows <- nrow(m) ncols <- ncol(m) sqrt(sum(apply(m,1,function(x) sum(x^2) - sum(x)^2/ncols))/(nrows*(ncols-1))) }
here's example
child_data <- data.frame( height_a=c(64.50,71.00,58.00,58.00,70.50,69.00,63.00,65.00,62.00,68.00), height_b=c(64.00,71.50,59.00,58.00,71.50,67.50,64.00,64.50,62.00,68.00) ) tem(child_data) # 0.5477
this figure presented in paper referenced.
then, example (three columns)
child_data$height_c <- c(63.5,71.3,59.0,58.5,71.4,67.4,64.2,64.50,62.5,67.5) tem(child_data) # 0.5
Comments
Post a Comment