FitOptions-class {MIGSA} | R Documentation

## FitOptions S4 class implementation in R

### Description

This S4 class contains the parameters to provide for model fitting. If the vector of samples is provided (must be two different, e.g. c("C1", "C1", "C2")) then it will contrast C1 vs. C2. If not, it should be provided with a data.frame x, the formula and the contrast, it will create the model matrix using x as data, and the formula.

### Usage

    FitOptions(x, ...)

    ## Default S3 method:
    FitOptions(x, ...)

    ## S3 method for class 'data.frame'
    FitOptions(x, formula, contrast, ...)

### Arguments

`x` | There are two options for x: It can be a character vector containing the two conditions (length must be the same as the number of subjects to use). It can be a data.frame used as data by `model.matrix`.
`...` | not in use.
`formula` | (only used if x is data.frame) used by `model.matrix`.
`contrast` | (only used if x is data.frame) the contrast to test.

### Value

FitOptions object.

### Examples

    ## Supose we have 15 subjects, the first 8 from Condition1 and the last 7
    ## from Condition2, lets create the corresponding FitOptions object to test
    ## Condition1 vs. Condition2.
    l <- c(rep("Condition1", 8), rep("Condition2", 7))
    fit_options <- FitOptions(l)
    ## Otherwise if we have the data and formula for model.matrix function and
    ## the desired contrast, we can create the FitOptions object as:
    myData <- data.frame(cond = c(rep("Condition1", 8), rep("Condition2", 7)))
    myFormula <- ~ cond - 1
    myContrast <- c(-1, 1)
    fit_options <- FitOptions(myData, myFormula, myContrast)

[Package MIGSA version 1.14.1 Index]