meansTest-methods {Cardinal} | R Documentation

## Linear model-based testing for summarized imaging experiments

### Description

Performs hypothesis testing for imaging experiments by fitting linear mixed models to summarizations or segmentations.

### Usage

    ## S4 method for signature 'SparseImagingExperiment'
    meansTest(x, fixed, random, groups = run(x),
            BPPARAM = bpparam(), ...)

    ## S4 method for signature 'SparseImagingExperiment'
    segmentationTest(x, fixed, random, groups = run(x),
            classControl = c("Ymax", "Mscore"),
            BPPARAM = bpparam(), ...)

    ## S4 method for signature 'SpatialDGMM'
    segmentationTest(x, fixed, random, model = modelData(x),
            classControl = c("Ymax", "Mscore"),
            BPPARAM = bpparam(), ...)

    ## S4 method for signature 'MeansTest'
    summary(object, ..., BPPARAM = bpparam())

    ## S4 method for signature 'SegmentationTest'
    summary(object, ..., BPPARAM = bpparam())

### Arguments

`x` | An imaging dataset or segmented/summarized imaging dataset.
`fixed` | A one-sided formula giving the fixed effects of the model on the RHS. The response will added to the LHS, and the formula will be passed to the underlying modeling function.
`random` | A one-sided formula giving the random effects of the model on the RHS. See `lme` for the allowed specifications.
`groups` | The summarization units. Pixels from different groups will be segmented/summarized separately. Each distinct observational unit (e.g., tissue sample) should be assigned to a unique group.
`model` | An integer vector or `list` specifying which fitted model to plot. If this is an integer vector, it should give the rows indices of `modelData(x)` to use for plotting. Otherwise, it should be a list giving the values of parameters in `modelData(x)`.
`classControl` | Either the method used to match segmented classes to the fixed effects, or a list where each element is a vector of name-value pairs giving the mapping between groups and classes (e.g., c(group1=class1, group2=class2, ...)). For automated matching methods, 'Ymax' means to use the classes with the highest mean response for each group, and 'Mscore' means to select classses based on a match score quantifying the overlap between classes and fixed effects.
`...` | Passed to internal linear modeling methods.
`object` | A fitted model object to summarize.
`BPPARAM` | An optional instance of `BiocParallelParam`. See documentation for `bplapply`.

### Value

An object of class `MeansTest` or `SegmentationTest`, which is a `ResultImagingExperiment`, where each element of the `resultData` slot contains at least the following components:

`model`:

  A linear model fitted using either `lm` or `lme`.

`data`:

  The summarized data used to fit the model.

### Author(s)

Dan Guo and Kylie A. Bemis

### See Also

`lm`, `lme`, `spatialDGMM`

### Examples

    set.seed(1)
    x <- simulateImage(preset=4, nruns=3, npeaks=10,
        dim=c(10,10), peakheight=5, peakdiff=2,
        representation="centroid")

    groups <- replace(run(x), !(x$circleA | x$circleB), NA)

    fit <- meansTest(x, ~ condition, groups=groups)

    modelData(fit)

[Package Cardinal version 2.2.6 Index]