How can I get RR according to scope from the GAM model?

How can I get RR according to scope from the GAM model?

For example, temperature <18, RR is ?, when temperature>18, RR is XX

is it possible through gamRR package?
This package shows RR in certain temperature point.

Thank you

Hi @rorong,
Welcome to the RStudio Community Forum.

You can increase the number of estimated points in gamRR() by increasing the n.points= argument. Not sure if that's what you wanted.

# Using the help example
library("mgcv")
dat <- gamSim(1,100,dist="poisson",scale=.25)
fit <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),family=poisson,dat,method="REML")
plot(fit,select=2)

library(gamRR)
gamRR(
  fit=fit,
  ref=c(x0=dat$x0[1],x1=dat$x1[1],x2=dat$x2[1],x3=dat$x3[1]),
  est="x1",
  data=dat,
  n.points=100,   # increased from default of 10
  plot=TRUE,
  ylim=NULL) -> results.df

library(dplyr)

results.df %>% 
  filter(x > 0.9)

results.df %>% 
  filter(x < 0.1)

HTH

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.