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.

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

Value

a data frame ready for Freesurfer LMM use.

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

Examples

if (FALSE) { site_keeper(MOAS) site_keeper(MOAS, "ousSkyra") site_keeper(MOAS, "ousAvanto") }