[R] Obtaining predicted values for glm() function

DHIMAN BHADRA dhimanbhadra at gmail.com
Fri Aug 15 07:54:17 CEST 2014


Dear all.

I am trying to relate daily deaths in a given city with air pollution
values. The model I am using is as follows:

model <- glm(deaths ~ pollution + ns(time, 13) + ns(temp, 7) + ns(rh, 5) +
dow + holiday, family=quasipoisson, data=city)

Where -
deaths: daily number of deaths
pollution: daily measured levels of air pollution
ns(time, 13): smooth function (i.e. cubic spline) of time with 13 degrees
of freedom
ns(temp, 7): smooth function (i.e. cubic spline) of temperature with 7
degrees of freedom
ns(rh, 5): smooth function (i.e. cubic spline) of humidity with 5 degrees
of freedom
dow: day of the week
holiday: dummy variable to indicate public holidays

Having run this model, how do I obtain predicted values of deaths for any
given set of pollution values? Any suggestions will be much appreciated.

Thanks in advance,
Dhiman Bhadra
Assistant professor.
IIM Ahmedabad.

	[[alternative HTML version deleted]]



More information about the R-help mailing list