PsychModels {MixedPsy} | R Documentation |
Fit Multiple Psychometric Functions with Generalized Linear Models (GLM)
Description
The function fits psychometric functions to data using glm
for multiple groups. It supports the use of a binomial error distribution.
Usage
PsychModels(data, group_factors = NULL, formula, link = "probit")
Arguments
data |
a data frame containing the variables to be used in the model. |
group_factors |
a character vector specifying the grouping variables in the dataset. If |
formula |
the formula of the |
link |
the link function. A character string specifying the link function to be used. By default, |
Details
This function allows the fitting of psychometric functions to grouped data. If grouping variables are provided through group_factors
, separate models are fit to each group. The function returns a list of models, one for each group, where the model for each group is fitted using the specified formula
and link
.
The models are returned as a named list, with each list element containing the fitted GLM model and the associated group-level information.
See Also
Examples
model_list <- PsychModels(formula = cbind(Longer, Total - Longer) ~ X,
data = simul_data,
group_factors = "Subject")
model_list_vibro <- PsychModels(vibro_exp3,
group_factors = c("subject", "vibration"),
formula = cbind(faster, slower) ~ speed)