;, "f3", "time")
> >
> > # lag function based on Wood (book 2017, p.349 and gamair package
> > documentation p.54
> > # https://cran.rstudio.com/web/packages/gamair/gamair.pdf)
> > lagard <- function(x,n.lag=7) {
> > n <- length(x); X <- ma
(dat$humidity), N)
pred_rain <- rep(median(dat$rain), N)
pd <- data.frame(temp = pred_temp, lag = pred_lag, humidity =
pred_humidity, rain = pred_rain)
# make predictions
predictions <- predict(mod, pd, type = "terms")
On Fri, 22 Jul 2022 at 09:54, Simon Wood 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 lag x relative risk. I know
how to use plot.gam and vis.ga
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
I'm not sure if geom_ribbon works with categorical data. It didn't
work for me, so I have coded location as a numeric, which works. You
can then manuall re-label the tick marks, as per the code below.
Others may be able to add to the code to add a legend, or propose a
different solution altogether,
Dear list,
I am making a perspective plot of my generalised additive model (GAM)
named a1b, using vis.gam() in mgcv, which in turn makes use of the
persp function in base R.
Code is as follows:
library(mgcv)
vis.gam(x = a1b,
view = c("wbgt_max", "lag"),
plot.type = "persp",
ke it a binary predictor or a categorical one with fewer
> > levels, perhaps 14 (for heaping in each year) or 12 (for each calendar
> > month). I have no idea whether that would help but it seems worth a try.
> >
> > Michael
> >
> > On 08/06/2022 18:15, jade.shoda
;
> -Original Message-
> From: R-help On Behalf Of jade.shodan--- via
> R-help
> Sent: Sunday, June 5, 2022 3:02 PM
> To: r-help@r-project.org
> Subject: [R] High concurvity/ collinearity between time and temperature in
> GAM predicting deaths but low ACF. Does this matter?
>
8 matches
Mail list logo