make.design: Create a Design Matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

Create a design matrix for a linear model

Usage

1
  make.design(target, cov, int=NULL)

Arguments

target

a data frame contains chip and covaraite information, or experimental phenotypes recorded in eSet and ExpressionSet-derived classes

cov

a list of 1-n covariates

int

if int=NULL, the interaction effect is not considered; otherwise, use two integers to indicate which covariates are considered for interaction effect. For example, if cov<-c("estrogen","drug","time") and you are considering the interaction between "estrogen" and "time", then you would write int=c(1,3)

Value

a matrix containing design matrix for the linear model

Author(s)

Xiwei Wu xwu@coh.org, Xuejun Arthur Li xueli@coh.org

See Also

make.contrast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
target<-data.frame(drug=(c(rep("A",4),rep("B",4),rep("C",4))), 
gender=factor(c(rep("M",6),rep("F",6))), 
group=factor(rep(c(1,2,3),4)))
			 
#To create a design matrix using "drug", "gender" as covariates
design1<-make.design(target, c("drug","gender"))
	
#To create a design matrix by using "drug","gender","group" as covariates, 
#and consider the interaction effect of "drug" and "group"
design2<-make.design(target, c("drug","gender", "group"), int=c(1,3))

Example output

Loading required package: affy
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: limma

Attaching package: 'limma'

The following object is masked from 'package:BiocGenerics':

    plotMA


Attaching package: 'AffyExpress'

The following object is masked from 'package:BiocGenerics':

    Filter

The following object is masked from 'package:base':

    Filter

Warning message:
In read.dcf(con) :
  URL 'http://bioconductor.org/BiocInstaller.dcf': status was 'Couldn't resolve host name'

AffyExpress documentation built on Nov. 8, 2020, 7:50 p.m.