I use SPSS, but am forced to use R for exact logistic regression. So I'm brand new to R (and hating it so far) and also new to logistic regression. I've read the original elrm paper and looked at examples of its use. However, I can't find information on the questions below (after the data description).
The fit of two models of cognitive processing was compared for each subject in each of 3 conditions. My binary dependent variable is whether the difference in model fits was significant or not (my "Success" variable below). I have three experimental Conditions: 0, 1, and 2. 0 is my reference group. My question is: is there an overall effect of Condition? If so, which conditions differ? The specific alternative hypothesis is that the proportion/probability of "success" should be greater in conditions 0 and 1 than in condition 2. My data look like
...and so on. SPSS actually creates the dummy variables for you on the fly but they are easy enough to create explicitly.
Question 1: I have read that to use elrm you have to enter the data such that the response variable represents success/number of trials. And as far as I can tell elrm doesn't create dummy variables automatically. I've seen examples of tables representing this data structure, but can't find any step-by-step examples of getting raw data into that format, espescially given a one-variable 3-levels situation. Is there an example out there that I'm missing? If not, is this what the data should look like?
I'm not sure how I'd enter the dummy variables into the formula...just as separate variables?
Question 2: I can see how I can get the tests of the coefficients of the dummy variables. But I can't figure out how to get a test of the overall effect of the independent variable. I need to evaluate the overall effect of Condition before looking at individual conditions. Is there a way to get that out of elrm? (I found an example of this done for the aod package which runs regular logistic regression but not exact logistic regression.)
Question 3: I can't find a description of what the p-value for individual coeffeicients represents in elrm. Is this is for the Wald test?
elrm
or something else? If you're finding R difficult (and coming from SPSS it might be hard), have you seen this? The author also has a more recent book by the same title. $\endgroup$elrm
somehow didn't handle factors by itself, it's easy to generate a set of dummies in R - e.g. if you have a factor calledx
, thenmodel.matrix(~x)[,-1]
will generate dummies for every factor level after the first. Try(x=as.factor(sample(LETTERS[1:3],10,replace=TRUE)))
;model.matrix(~x)[,-1]
and see] $\endgroup$as.factor
was doing (still working on getting the data structure down). I'll have to look into the examples in more detail. Thanks! $\endgroup$