Classification accuracy of binomial queries ()

I used up my (non-r-savy) brains to get R to produce a percentage of correct predictions for the binomial flicker model. I know that this is not too informative statistically, but is often reported; therefore, I would like to report this.

DATA:

Dependent variable: Tipo, which has 2 values: 's' or 'p'. A bunch of predictor factors, not just one continuous variable. 2 random interceptions: test subject, and nouns to which he / she answered

code used for the model:

model <- glmer(Tipo ~ agency + tense + 
               co2pr + pr2pr + socialclass + 
               (1|muestra) + (1|nouns), 
               data=datafile, family="binomial",
               control=glmerControl(optimizer="bobyqa"), 
               contrasts=c("sum", "poly"))

I know that there is a function predict()that takes a model object and makes predictions based on this model, but I cannot make it work for me. I would be grateful if you would like to share this code.

Thanks in advance.

+4
1

, ( [ " ROC" "AUC" ] ...) 0,5 ( , - , , ),

p <- as.numeric(predict(model, type="response")>0.5)

0 1 .

mean(p==datafile$Tipo)

.

table(p,datafile$Tipo)

vs-.

+6

All Articles