Description Usage Arguments Value Note Author(s) See Also Examples

To calculate the relative risk (RR) for the generalized additive model

1 |

`fit` |
an object of gam() |

`ref` |
a vector of the independent variables at referenced level, please note that the names of the variables in 'ref' should be matched to those in the model |

`est` |
character, to indicate which numeric variable should be calculated the RR, please note that the name of the variable in 'est' should be matched to which in the model |

`data` |
the name of the data in the gam() |

`n.points` |
integer, the number of points of 'est' to be estimated, the default is 10 |

`plot` |
logic, to indicate whehter to plot the rr |

`ylim` |
a vector of tow numeric number |

`data frame` |
a data frame including variables of 'x', 'rr', 'u', and 'l' |

`x` |
the value of 'est' variable |

`rr` |
the RR coresponding to 'est' variable |

`u` |
the 95 percent upper limit of the 'rr' |

`l` |
the 95 percent lower limit of the 'rr' |

Please feel free to contact us, if you have any advice and find any bug!

Update description:

version 0.2.0: 1. checking procedure for the arguments was added. The function will stop if the number of variables in the 'ref' argument was not equal to those in the model or some variables in the 'ref' argument were not in the model.

version 0.3.0: 1. gamRR.boot() function was added.

version 0.4.0: 1. the plot styles of gamRR() and gamRR.boot() were united. 2. the independent variable with factor() or as.factor() was allowed.

version 0.5.0: 1. fix the error "object 'nxy' not found" in gamRR().

version 0.6.0: 1. fix the error if there were missing data. 2. fix the warnings of 'replace' in 'data.frame'. 3. the independent variable with offset() or log() was allowed.

version 0.7.0: 1. the independent variable with arguments was allowed, e.g., "s(x,k=3)".

more functions will be included in 'gamRR' package!

Zhicheng Du<dgdzc@hotmail.com>, Wangjian Zhang<wzhang27@albany.edu>, Yuantao Hao<haoyt@mail.sysu.edu.cn>

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
#require("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)
#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=10,
# plot=TRUE,
# ylim=NULL)
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.