问题 I am using the gls function from the nlme package. You can copy and paste the following code to reproduce my analysis. library(nlme) # Needed for gls function # Read in wide format tlc = read.table("http://www.hsph.harvard.edu/fitzmaur/ala2e/tlc.dat",header=FALSE) names(tlc) = c("id","trt","y0","y1","y4","y6") tlc$trt = factor(tlc$trt, levels=c("P","A"), labels=c("Placebo","Succimer")) # Convert to long format tlc.long = reshape(tlc, idvar="id", varying=c("y0","y1","y4","y6"), v.names="y",