Re: [R] mgcv: relative risk from GAM with distributed lag

2022-07-23 Thread jade.shodan--- via R-help
Hi Simon and all, I've corrected some mistakes in setting up the prediction data frame (sorry, very stressed and sleep deprived due to closing in deadlines), but am having problems getting the perspective plot using persp(). I've calculated relative risk (RR) but am having trouble getting the per

Re: [R] mgcv: relative risk from GAM with distributed lag

2022-07-22 Thread jade.shodan--- via R-help
Hi Simon, Thanks for the pointers! But I'm not sure what to do with the 'time' variable. (I don't want to make predictions for specific points in time). I coded as follows (full reproducible example at bottom of email), but get a warning and error: N <- 1000 # number of points for smooth to

Re: [R] mgcv: relative risk from GAM with distributed lag

2022-07-22 Thread Simon Wood
On 21/07/2022 15:19, jade.shodan--- via R-help wrote: Hello everyone (incl. Simon Wood?), I'm not sure that my original question (see below, including reproducible example) was as clear as it could have been. To clarify, what I would to like to get is: 1) a perspective plot of temperature x l

Re: [R] mgcv: relative risk from GAM with distributed lag

2022-07-21 Thread jade.shodan--- via R-help
Hello everyone (incl. Simon Wood?), I'm not sure that my original question (see below, including reproducible example) was as clear as it could have been. To clarify, what I would to like to get is: 1) a perspective plot of temperature x lag x relative risk. I know how to use plot.gam and vis.ga

[R] mgcv: relative risk from GAM with distributed lag

2022-07-19 Thread jade.shodan--- via R-help
Dear list members, Does anyone know how to obtain a relative risk/ risk ratio from a GAM with a distributed lag model implemented in mgcv? I have a GAM predicting daily deaths from time series data consisting of daily temperature, humidity and rainfall. The GAM includes a distributed lag model bec