Reference
qdecr_fastlm
Vertex-wise linear regression
On this page
Usage
qdecr_fastlm(
formula,
data,
id,
hemi,
weights = NULL,
dir_out = getwd(),
project,
n_cores = 1,
target = "fsaverage",
fwhm = ifelse(measure == "pial_lgi", 5, 10),
mcz_thr = 0.001,
cwp_thr = 0.025,
mgh = NULL,
mask = NULL,
mask_path = system.file("extdata", paste0(hemi, ".fsaverage.cortex.mask.mgh"),
package = "QDECR"),
dir_subj = Sys.getenv("SUBJECTS_DIR"),
dir_fshome = Sys.getenv("FREESURFER_HOME"),
dir_tmp = dir_out,
dir_out_tree = TRUE,
file_out_tree = !dir_out_tree,
clean_up_bm = TRUE,
clean_up = TRUE,
clobber = FALSE,
verbose = TRUE,
save = TRUE,
save_data = TRUE,
debug = FALSE,
custom_measure = NULL,
prep_fun = "prep_fastlm",
analysis_fun = "analysis_chunkedlm",
chunk_size = 1000
)Arguments
formulaan object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. See
?lm.dataa required argument that contains a data frame, a list of data frames or an imputed object that is supported by the
imp2listfunction (mice, mi, etc.).idthe name of the id variable that matches the dataset to the Freesurfer output
hemihemisphere to analyze ("lh" or "rh")
weightsOptional vector of weights for the observations. See
?lm.dir_outthe directory where to save the data to (defaults to the current directory)
projectthe base name you want to assign to the output files
n_coresthe number of cores to be used
targetthe target template (default = "fsaverage")
fwhmfull width half max (default = 10 mm, for pial_lgi it is 5 mm)
mcz_thrA numeric value for the Monte Carlo simulation threshold (default: 0.001). Any of the following are accepted (equivalent values separate by
/): 13/1.3/0.05, 20/2.0/0.01, 23/2.3/0.005, 30/3.0/0.001, 33/3.3/0.0005, 40/4.0/0.0001.cwp_thrthe cluster-wise p-value threshold on top of all correction (default = 0.025, as there are 2 hemispheres)
mghNOT IMPLEMENTED; path to existing merged mgh file, default is NULL
maskmgh file to mask analysis; default is to use the cortex label from the target
mask_pathpath to the mask; default is the cortex mask that is provided with the QDECR package
dir_subjdirectory contain the surface-based maps (mgh files); defaults to SUBJECTS_DIR
dir_fshomeFreesurfer directory; defaults to FREESURFER_HOME
dir_tmpdirectory to store the temporary big matrices; useful for shared memory; defaults to
dir_outdir_out_treeif TRUE, creates a dir_out/project directory. If FALSE, all output is placed directory into dir_out
file_out_treeif TRUE, adds the full project name to the output file names. By default it is the inverse of dir_out_tree
clean_up_bmif TRUE, cleans all big matrices (.bk) that were generated in dir_tmp
clean_upNOT IMPLEMENTED; will be used for setting cleaning of other files
clobberif TRUE, ignores already existing directories and writes over them; if FALSE, stops and warns user that a given directory already exists
verboseif TRUE, writes out standard log; if FALSE, no output is generated
saveif TRUE, saves the output to a .rds file
save_dataif TRUE, includes the raw data + design matrices in the .rds file
debugNOT IMPLEMENTED; will output the maximal log to allow for easy debugging
custom_measurea string that starts with "qdecr_" followed by the name of a surface file that is not created by FreeSurfer by default (e.g. "qdecr_cc" or "qdecr_test"). Note that the surface files MUST be located in the surf subdirectory of each individual's FreeSurfer output, and the files must follow the naming conventions of the other .mgh files (e.g. "lh.test.fwhm10.fsaverage.mgh")
prep_funName of the function that needs to be called for the preparation step (do not touch unless you know what you are doing!)
analysis_funName of the function that needs to be called for the analysis step (do not touch unless you know what you are doing!)
chunk_sizeInteger; the desired chunk size for the chunked lm
Value
returns an object of classes "vw_fastlm" and "vw".