Learn R Programming

rtemis (version 0.79)

massGAM: Mass-univariate GAM Analysis

Description

Fits a GAM for each of multiple outcomes using a fixed set of features (many y's, one X).

Usage

massGAM(x, y, covariates = NULL, x.name = NULL, y.name = NULL,
  k = NULL, family = gaussian(), weights = NULL, method = "REML",
  n.cores = rtCores, save.mods = FALSE, save.summary = TRUE,
  print.plots = FALSE, outdir = NULL, labeledNifti = NULL,
  save.plots = FALSE, new.x.breaks = 9)

Arguments

x

Numeric vector or matrix / data frame of features i.e. independent variables

y

Float, Matrix / data frame: Outcomes

x.name

String: Name of the predictor

y.name

String, vector: Names of the outcomes

k

Integer. Number of bases for smoothing spline

family

family argument for mgcv::gam

weights

Numeric vector: Weights for cases. For classification, weights takes precedence over ipw, therefore set weights = NULL if using ipw. Note: If weight are provided, ipw is not used. Leave NULL if setting ipw = TRUE. Default = NULL

method

Estimation method for GAM

n.cores

Integer. Number of cores to use

save.mods

Logical. Should models be saved

save.summary

Logical. Should model summary be saved

print.plots

Logical Should plots be shown

outdir

Path to save output

labeledNifti

String. Path to labeled nifti file.

save.plots

Logical. Should plots be saved

new.x.breaks

Integer. Number of splits in the range of x to form vector of features for estimation of fitted values

weight

Vector. Weights for GAM

Details

NA in the input will be kept as NA in the results, maintaining n of cases.