glsCAR1: Fit General Linear Model with 'corCAR1' Correlation Structure...

Description Usage Arguments Value Examples

View source: R/TC_CAR1.R

Description

This 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.

Usage

1

Arguments

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.

Value

Output is a vector including the following components

aic

AIC of the fitted model.

s2

estimate of error variance.

rho

correlation parameter in corCAR1 correlation matrix.

fixed

fixed effects (estimates of regression parameters).

varbeta

the estimates of variance of fixed effects, just include lower part and diagonal part of the variance-covariance matrix.

Examples

1
2
3
4
5
6
7
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

rmRNAseq documentation built on Nov. 8, 2019, 5:06 p.m.