0

So I have a glm that is defined like this

oring.glm = glm(oring.data$Damaged ~ oring.data$Temp, data = oring.data, family=binomial)

The data looks like this

Oring   Temp
1        15
0        20
1        30

I want to predict what happens to the Oring at a specific temperature

I've tried doing this

logodds = predict(oring.glm, list(Temp=31))

But this gives me a list of values, as opposed to a single odds value.

How do I get that?

Prradep
  • 5,506
  • 5
  • 43
  • 84
praks5432
  • 7,246
  • 32
  • 91
  • 156

1 Answers1

0

If I'm correct to assume that you DV is dichotomous, then I'd use the logit link function, and access the predicted value of my fit using simple indexing:

g=glm(y~x,family=binomial("logit")) #fit
predict(g)[1234] # gives the predicted value of y for the x=1234.
ben_aaron
  • 1,504
  • 2
  • 19
  • 39