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()get_scaling_function()get_pca_function()build_model()run_regression()remove_covars()get_effect_matrix()do_pca()do_reduce_dimensions()clean_pca()clean_alasca()do_validate()get_validation_percentiles()get_regression_predictions()prepare_validation_run()get_bootstrap_data()new()AlascaModel$new(df, formula, effects, ...)log()Function for logging messages using the log4r package
plot()Main function for plots
flip()Switch the sign of scores and loadings
get_levels()Returns all the levels of a given column
get_PCs()Returns the most interesting principal components (i.e., components explaining more than a given limit of variance: explanatory_limit)
get_predictions()get_scores()Return scores
get_loadings()Return loadings
get_covars()save_validation()Write scores, loadings, covars and predictions from validation run to database and remove data from memory
rotate_matrix_optimize_score()Rotate model loadings and scores with procrustes. This function checks all combinations of signs to minimize variation