fs_lmm: Create a data.frame that is ready for use in Freesufers...

View source: R/fs_lmm.R

fs_lmmR Documentation

Create a data.frame that is ready for use in Freesufers linear mixed models

Description

fs_lmm Creates a data.frame of subsetted row and formatted columns ready for use in Freesurfers (6.0) linear mixed models. Design matrices are created for the grouping.var factors, and numeric variables are z-transformed.

Usage

fs_lmm(
  data,
  grouping.var,
  numeric.var,
  missing.action = "mean",
  keep = "long",
  file
)

Arguments

data

The MOAS or a MOAS generated file.

grouping.var

String vector specifying the column names of categorical/ordinal factors.

numeric.var

A string vector of column names for numeric, scalar co-variates.

missing.action

Action to take on missing data i the numeric.var

keep

For double/triple scans, which data should be kept. option calls site_keeper.

file

Optional string specifying file name to be saved

Details

Available options for 'missing.action' are:

  • "delete"delete observations with any missing numeric.vars

  • "mean"replace missing with mean for that participant

  • "all"replace all values with the mean for that participant

  • "first"replace all values with the first observation for that participant

Value

a data frame ready for Freesurfer LMM use.

Examples

## Not run: 
site_keeper(MOAS)
site_keeper(MOAS, "ousSkyra")
site_keeper(MOAS, "ousAvanto")

## End(Not run)

LCBC-UiO/MOAS documentation built on Aug. 28, 2023, 3:29 a.m.