search for: datmean

Displaying 1 result from an estimated 1 matches for "datmean".

Did you mean: datamean
2018 Apr 09
1
linear regression with repeated measures
...firm dat <- matrix(rep(1:12,7)+rnorm(84),nc=7) dat[,4:7] <- 1.3*dat[,4:7]+runif(48) # some individual measures may be missing : dat[2:3,4] <- NA colnames(dat) <- paste(rep(c("a","b"),3:4),c(1:3,1:4),sep="") # In analogy to the ample documentation of lm() : datMean <- cbind(aM=rowMeans(dat[,1:3]),bM=rowMeans(dat[,4:7])) (lmMean <- lm(bM ~ aM,data=as.data.frame(datMean))) # I suppose the estimated parameters (intercet & slope) may be correct but sice the degrees of freedom are not made of means I am convinced they are incorrect and thus any statistic...