| AlascaModel | R Documentation |
The object builds the ALASCA model and contains the data
dfData table/frame. The data to analyze
formulaAn AlascaForula object
wideBoolean. Whether the provided data is in wide format
scale_functionHow to scale the data. Options are NULL, custom function, or "sdall", "sdref", "sdt1", "sdreft1"
ignore_missingIf TRUE, ignore missing predictive values
ignore_missing_covarsIf TRUE, ignore missing covariate values
versionVersion number
update_dateDate of latest update
separate_effectsIf TRUE, try to separate the effects
equal_baselineIf TRUE, remove interaction between baselines
effect_listList. Contains info related to the effects
n_validation_foldsInteger. If using jack-knife validation, exclude 1/n_validation_folds of the participants at each iteration
n_validation_runsInteger. Number of iterations to use for validation
validation_quantile_methodInteger between 1 and 9. See stats::quantile() for details
save_validation_idsIf TRUE, save the participants in each validation iteration to a csv file
optimize_scoreIf TRUE, test all combinations of signs for the most important loadings, and choose the combination being the best fit
validateIf TRUE, validate the model
validate_regressionIf TRUE, validate get marginal means
validationBoolean. Synonym to validate
validation_methodString. Defines the validation method; "bootstrap" (default) or "jack-knife"
validation_idsA data frame where each row contains the ids for one validation iteration
validation_assign_new_idsLogical. Assign new IDs during validation. Must be TRUE for reduce_dimensions to work
limitsCILower and upper quantile to use for validation
compress_validationInteger between 0 and 100. See fst::write_fst() for details
reduce_dimensionsBoolean. Use PCA to reduce data dimensions prior to analysis
pca_functionString or custom function. Which pca function to use for dimension reduction, either "prcomp" or "irlba" or "princomp" or custom function
save_to_diskWrite model data to disk to reduce memory usage
db_methodString. Use a "duckdb" or a "SQLite" database for validation data
filenameFilename for the saved model
filepathWhere to save the model. Defaults to ALASCA/<timestamp>
saveSave model data and plots
methodString. Can be "LM" or "LMM"
max_PCInteger. The maximal number of principal components to keep for further analysis
use_RfastBoolean. If TRUE (default), use Rfast, else use lm or lme4
p_adjust_methodString. See stats::p.adjust()
participant_columnString. The column used for IDs. If not provided, it will guess based on random effect or ID
stratification_columnString. Name of the column to use for stratification during validation
explanatory_limitOnly validate components explaining more than explanatory_limit of the variance
init_timeThe time when the object is initialized
log_toString deciding logging target: "all" (default), "file", "console", "none"
log_levelString. What level of log messages to print; "DEBUG", "INFO", "WARN", "ERROR"
do_debugBoolean. Log more details
finishedBoolean. Indicates whether the model has been successfully initiated
ALASCAList. Contains all model outputs: score, loading, explained and significant_PCs
get_plot_groupName of the grouping factor (used for plotting)
effect_termsList of the terms in the effect matrices
remove_embedded_data()AlascaModel$remove_embedded_data()
get_default_scaling_function()AlascaModel$get_default_scaling_function()
get_scaling_function()AlascaModel$get_scaling_function()
get_pca_function()AlascaModel$get_pca_function()
build_model()AlascaModel$build_model()
run_regression()AlascaModel$run_regression()
get_regression_coefficients()AlascaModel$get_regression_coefficients()
remove_covars()AlascaModel$remove_covars()
get_effect_matrix()AlascaModel$get_effect_matrix()
do_pca()AlascaModel$do_pca()
do_reduce_dimensions()AlascaModel$do_reduce_dimensions()
clean_pca()AlascaModel$clean_pca()
clean_alasca()AlascaModel$clean_alasca()
do_validate()AlascaModel$do_validate()
get_validation_percentiles()AlascaModel$get_validation_percentiles(objectlist)
get_validation_percentiles_regression()AlascaModel$get_validation_percentiles_regression(objectlist)
get_validation_percentiles_covars()AlascaModel$get_validation_percentiles_covars(objectlist)
get_validation_percentiles_loading()AlascaModel$get_validation_percentiles_loading(objectlist)
get_validation_scores()AlascaModel$get_validation_scores(objectlist = NULL, effect_i = 1)
get_validation_loadings()AlascaModel$get_validation_loadings(objectlist = NULL, effect_i = 1)
get_validation_percentiles_score()AlascaModel$get_validation_percentiles_score(objectlist)
get_regression_predictions()AlascaModel$get_regression_predictions()
get_validation_ids()AlascaModel$get_validation_ids()
prepare_validation_run()AlascaModel$prepare_validation_run(runN)
get_bootstrap_data()AlascaModel$get_bootstrap_data(df_raw, participants_in_bootstrap, modmat)
new()AlascaModel$new(df, formula, effects, ...)
finalize()AlascaModel$finalize()
update()Update the current model (used for validation)
AlascaModel$update()
log()Function for logging messages using the log4r package
AlascaModel$log(message, level = "INFO")
messageThe message to log
levelLevel of the message; DEBUG, INFO, WARN, ERROR, FATAL
plot()Main function for plots
AlascaModel$plot(effect = 1, component = 1, ...)
effectInteger or vector. Which(s) effect(s) to plot
componentInteger or vector. Which(s) component(s) to plot
get_residuals()Resample participants for validation
AlascaModel$get_residuals(variable = NULL)
set_effect_terms()AlascaModel$set_effect_terms()
set_design_matrices()AlascaModel$set_design_matrices()
flip()Switch the sign of scores and loadings
AlascaModel$flip(effect_i = 0, component = 0)
effect_iThe effect to reflect, 0 or NULL reflects the entire model
componentThe component to reflect, 0 or NULL reflects the entire model
get_ref()Returns the reference level of a given column
AlascaModel$get_ref(columns)
columnsA column containing factors
The reference level
get_levels()Returns all the levels of a given column
AlascaModel$get_levels(column, reduced = TRUE)
columnA column containing factors
reducedBoolean. If TRUE, returns the PCs instead of actual variables if dimensions are reduced with PCA
A vector with factor levels
get_PCs()Returns the most interesting principal components (i.e., components explaining more than a given limit of variance: explanatory_limit)
AlascaModel$get_PCs(x)
xIndex corresponding to the effect of interest
A vector with principal components
get_predictions()AlascaModel$get_predictions()
get_scores()Return scores
AlascaModel$get_scores(effect_i = 1, component = 1)
effect_iThe effect to reflect, 0 or NULL reflects the entire model
componentThe component to reflect, 0 or NULL reflects the entire model
get_loadings()Return loadings
AlascaModel$get_loadings(effect_i = 1, component = 1, n_limit = 0)
effect_iThe effect to reflect, 0 or NULL reflects the entire model
componentThe component to reflect, 0 or NULL reflects the entire model
n_limitReturn only two times this number of loadings (the n_limit highest and lowest loadings). Use 0 to return all (default)
get_covars()AlascaModel$get_covars(n_limit = 0)
n_limitReturn only two times this number of coefficients (the n_limit highest and lowest coefficients). Use 0 to return all (default)
print_version()Print ALASCA version
AlascaModel$print_version()
String with version number and date of latest update
save_validation()Write scores, loadings, covars and predictions from validation run to database and remove data from memory
AlascaModel$save_validation(ii)
iiNumber of the validation run
save_to_csv()Save scores, loading, covars, and predictions to csv files
AlascaModel$save_to_csv()
save_model()Save model to RDS and scores, loading, covars, and predictions to csv files
AlascaModel$save_model()
rotate_matrix_optimize_score()Rotate model loadings and scores with procrustes. This function checks all combinations of signs to minimize variation
AlascaModel$rotate_matrix_optimize_score(target)
targetRotate model (self) with this as target
rotate_matrix()Rotate model loadings and scores with procrustes
AlascaModel$rotate_matrix(target)
targetRotate model (self) with this as target
clone()The objects of this class are cloneable with this method.
AlascaModel$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.