Last chance! 50% off unlimited learning
Sale ends in
corCAR1
Correlation Structure for One
GeneThis function fits gls
model with REML estimation method,
corCAR1
correlation structure for one gene in a RNA-seq
repeated measures data, where data is log-transformed output from
voom
.
glsCAR1(d)
a data frame containing several columns. The first 4 columns are
y:
a vector of log-counts (obtained by voom
),
Subject:
a vector of subject/experimental units where repeated
measures are obtained (can be either numeric or factor), Time:
a
vector of time points (continuous, since we fit
corCAR1
), w:
weights to put in gls model, this is
the inverse of weights obtained by voom
The other
columns are exactly the same as design matrix.
Output is a vector including the following components
AIC of the fitted model.
estimate of error variance.
correlation parameter in corCAR1
correlation matrix.
fixed effects (estimates of regression parameters).
the estimates of variance of fixed effects, just include lower part and diagonal part of the variance-covariance matrix.
# NOT RUN {
data(res)
data(design)
data(covset)
d <- data.frame(cbind(y = res$ori.res$v$E[1,] ,Subject = covset$ear,
Time = covset$time, w = 1/res$ori.res$v$weights[1,], design))
glsout <- rmRNAseq:::glsCAR1(d)
glsout
# }
Run the code above in your browser using DataLab