getStats: Run a bunch of ROI stats in a linear model, per your...

Description Usage Arguments Value

Description

Run a bunch of ROI stats in a linear model, per your specifications

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
getStats(
  df,
  varOfInterest,
  covarOfInterest,
  otherCovarString,
  lut,
  colorMat,
  sigValue,
  multipleCorrectionMethod,
  outFileRoot
)

Arguments

df

A data frame in long format, organized as QuANTs-style output: dependent variable (freq. thicknesses, volumes, or cbf values, etc) in a column called "value" a column called "label" with the label numbers. Each row is one measurement for one person. Can have as many columns as you want (ie, ignores everything not specified") Also requires columns named as specified used as varOfInterest, covarOfInterest (if used), and otherCovarString (if used)

varOfInterest

A column name from df that you want to run stats on. Often either a column containing group status info or a score for a regression

covarOfInterest

A column name you want to use as a covariate in your linear model. Will also be used for plotting.

otherCovarString

A string you want to use for covariates of no interest. Won't be used for plots. For multiple values, use lm()-style formula "Covar1+Covar2+..."

lut

A look up table with label numbers in the first column and label names in the second column. Can have extra rows or columns, they will be ignored

colorMat

A table of colors that might get used in plots

sigValue

A value used for thresholding your statistics. If you want to show all data use 1.

multipleCorrectionMethod

Goes into p.adjust() to account for multiple comparisons. Will do this accounting for all labels in your input df. Default is none, common other choices are "bonferroni" and "fdr"

outFileRoot

Optional file root for output. If specified, will save 1) .txt file with all significant results and 2) plots for up to 5 labels (with 5 smallest p-values)

Value

A list object with 3 elements 1) a df containing significant labels from the lm() 2) summay(lm()) output from each label in your input df 3) a plot for each region in your df 1) (ie, one plot for each significant label)


caugolm/quants_qc_stats documentation built on Nov. 22, 2020, 4:26 p.m.