inverse of 'predict' function

后端 未结 5 623
有刺的猬
有刺的猬 2021-02-08 07:33

Using predict() one can obtain the predicted value of the dependent variable (y) for a certain value of the independent variable (x) for a

5条回答
  •  情歌与酒
    2021-02-08 07:49

    You just have to rearrange the regression equation, but as the comments above state this may prove tricky and not necessarily have a meaningful interpretation.

    However, for the case you presented you can use:

    (1/coef(model)[2])*(model$family$linkfun(30/50)-coef(model)[1])
    

    Note I did the division by the x coefficient first to allow the name attribute to be correct.

提交回复
热议问题