R/fs_lmm.R
fs_lmm.Rd
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 )
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 |
file | Optional string specifying file name to be saved |
a data frame ready for Freesurfer LMM use.
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