[BioC] Can I input ordinal variables into a model in Limma?

Gordon K Smyth smyth at wehi.EDU.AU
Sun Sep 1 02:51:47 CEST 2013


Dear Scott,

An ordinal variable is just a special case of a categorical variable, and 
you include it in the limma design matrix just as you would any other 
categorical variable.  For example:

   DiseaseState <- ordered(DiseaseState,
      levels=c("mild", "moderate", "severe"))
   design <- model.matrix(~DiseaseState)

etc.  By default, the first coefficient in this design will be the overall 
mean, the second will be linear trend (monotonic increase or decrease), 
and the third will be quadratic trend ("moderate" more extreme than the 
other two levels rather than intermediate between them).

Best wishes
Gordon


> Date: Fri, 30 Aug 2013 07:36:58 -0700 (PDT)
> From: "Scott Robinson [guest]" <guest at bioconductor.org>
> To: bioconductor at r-project.org, scott.robinson at glasgow.ac.uk
> Subject: [BioC] Can I input ordinal variables into a model in Limma?
>
>
> I am working on some microarray data where the samples come from 
> patients with different severities of disease state - something like 
> "mild", "moderate", "severe".
>
> I suppose this is an 'ordinal' variable, but only know how to input 
> categorical and continuous variables into the model and searching the 
> Limma manual for the word 'ordinal' doesn't get me anywhere.
>
> Is it possible to work ordinal variables into my model? If not and I 
> still want to use Limma is it best to treat it as categorical or 
> continuous? Or is there an alternative package I could use which has 
> this functionality?
>
> Many thanks in advance,
>
> Scott
>
> -- output of sessionInfo():
>
>> sessionInfo()
> R version 3.0.1 (2013-05-16)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> locale:
> [1] LC_COLLATE=English_United Kingdom.1252
> [2] LC_CTYPE=English_United Kingdom.1252
> [3] LC_MONETARY=English_United Kingdom.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United Kingdom.1252
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
> [1] limma_3.16.7          sparcl_1.0.3          lattice_0.20-23
> [4] corrplot_0.71         affyPLM_1.36.0        preprocessCore_1.22.0
> [7] simpleaffy_2.36.1     gcrma_2.32.0          genefilter_1.42.0
> [10] affy_1.38.1           Biobase_2.20.1        BiocGenerics_0.6.0
>
> loaded via a namespace (and not attached):
> [1] affyio_1.28.0        annotate_1.38.0      AnnotationDbi_1.22.6
> [4] BiocInstaller_1.10.3 Biostrings_2.28.0    DBI_0.2-7
> [7] grid_3.0.1           IRanges_1.18.3       RSQLite_0.11.4
> [10] splines_3.0.1        stats4_3.0.1         survival_2.37-4
> [13] XML_3.98-1.1         xtable_1.7-1         zlibbioc_1.6.0
>

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



More information about the Bioconductor mailing list