Search code examples
rparameterslogistic-regressionmulti-level

Multilevel logistic regression guessing parameter


I am working in R in package lme4 and in MPlus and have a following situation:

I want to predict variable B (which is dichotomous) from variable A (continous) controlling for random effects on the level of a) Subjects; b) Tasks.

A -> B (1)

The problem is that when I use model to predict the values of B from A, values below probability of 0.5 get predicted, and in my case that doesn´t make sense, because, if you guess at random, the probability of correct answer on B would be 0.5.

I want to know how I can constrain the model (1) in R or in MPlus so that it doesn´t predict values lower than 0.5 in variable B.

Thank you!


Solution

  • I found a solution to the question thanks to Mr Kenneth Knoblauch. Basically, you need the psyphy package to use mafc.logit function.

    For example, the code then looks like this:

    mod <- glm(B ~ A, data = df, family = binomial(mafc.logit(.m = 2)))
    

    It then involves the guessing parameter for (.m = 2) - two-choice tasks.

    Cheers!