I have a problem that I am trying to resolve with no success. More than two days searching and I didn’t get a single clue. Sorry if the answer is out there and I didn’t find it.
Suppose that you have a logistic equation regression (binary model) from an old model that you estimated some years ago. Therefore you know the parameters βk (k = 1, 2, ..., p) because they were estimated in the past. But you don’t have the data that were used to fit the model.
My question is: can I introduce this old estimated logistic model in R as an object (corresponding to a logistic regression model)?
I would like to use the “predict” function to prove this logistic regression with a new set of data (present data) and then check the validity of this old model standing the test of time. And to use this function you need the object of the logistic regression model.
Thank you very much in advance.
You can create a glm fit with only an offset created from the coefficients that you have, then use the regular predict function with that. For example using the iris data (first fitting a model on the real data, then fitting a new model using dummy data and the coefficients from the first fit):
Per my comment, I think you could start by just calculating predictions directly from the coefficients. Here's an example that compares the output from
predict.glm
to predicted probabilities calculated directly on the data:This is obviously not a general solution, nor does it properly handle uncertainty, but I think it's a better approach than hacking
predict
.