gamRandomise: Generate FSL Randomise call for a GAM Model

Description Usage Arguments Value Examples

View source: R/gamRandomise.R

Description

This function is able to generate all the necessary files to run randomise with a GAM Model This script will write out all design and contrast files This function will run a f-test to compare a full and reduced model (a model with and without spline)

Usage

1
2
gamRandomise(image, maskPath = NULL, formulaFull, formulaRed, subjData,
  outDir, nsim = 500, thresh = 0.01, run = FALSE)

Arguments

image

Input path of 'nifti' image or vector of path(s) to images. If multiple paths, the script will all mergeNiftis() and merge across time.

maskPath

to mask. Must be a binary mask

formulaFull

Must be the formula of the full model (i.e. "~s(age,k=5)+sex+mprage_antsCT_vol_TBV")

formulaRed

Must be the formula of the reduced model (i.e. "~sex+mprage_antsCT_vol_TBV")

subjData

Dataframe containing all the covariates used for the analysis

outDir

output directory for randomise

nsim

Number of simulations

thresh

significance threshold

run

FALSE will only print randomise command but won't it

Value

Return randomise command

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

subjData = mgcv::gamSim(1,n=400,dist="normal",scale=2)
OutDirRoot="Output Directory"
maskName="Path to mask"
imagePath="Path to output"
covsFormula="~s(age,k=5)+sex+mprage_antsCT_vol_TBV"
redFormula="~sex+mprage_antsCT_vol_TBV"

gamRandomise(image = imagePath, maskPath = maskName, formulaFull = covsFormula, 
           formulaRed = redFormula, subjData = subjData, outDir = OutDirRoot)


## End(Not run)

angelgar/voxel documentation built on Dec. 31, 2019, 3:09 p.m.