-1

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!

User33268
  • 159
  • 1
  • 11
  • 1
    Do you have any code that shows what you already have tried? Did you use the `predict()` function, were predictions conditioned on random effects or not, do you have sample data to reproduce your example? – Daniel May 11 '17 at 09:39

1 Answers1

0

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!

User33268
  • 159
  • 1
  • 11