Description Usage Arguments Value Author(s) References Examples

PanJen is built on the idea that the choice of a functional form can be extrapolated from model fit measures. The function provides a ranking of different transformations according to their Baysian Information Criterion (BIC). The BIC provides a relative goodness-of-fit measure while accounting for the complexity of the model. The function provides BIC for a set of predefined transformations aswell as a model without the variable in question and a socalled smoothing of the variable. The models are estimated a Generalized additive model (GAM).A GAM is a special case of the Generalized Linear Model (GLM), where it is possible to include one or more so called smoothing functions. A smoothing function is a non-parametric way to include a continuous independent variable in a parametric model and thus make it semi-parametric. Please see Wood (2006) for an elaboration. The printed output is a table with the transformations sorted according to their explanatory power measured by AIC. The table shows both AIC and BIC for each regression, where BIC penalize for the number of explanatory variables

1 | ```
fform(data,variable,base_form, distribution=gaussian)
``` |

`data` |
A data.frame |

`variable` |
A character-string with the name of the variable to test |

`base_form` |
A formula-object with the regressions without the variable that is tested |

`distribution` |
Assumed distribution, see mgcv-vignette for an elaboration. Default is gaussian |

`rank.table ` |
The printed table. The transformations are ranked according to their explanatory power measured by AIC. The table shows both the AIC and BIC value, where the BIC value penalizes for the number of variables |

`models ` |
A list of estimated models |

`dataset ` |
A dataframe with the dataset |

Toke Emil Panduro & Cathrine Ulla Jensen

Simon Wood, Generalized Additive Models: an introduction with R.,hapman and Hall/CRC, 2006

1 2 3 4 5 |

```
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
AIC BIC ranking (BIC)
log(x) 290.04 352.49 1
x^2 290.09 352.53 2
x 291.70 354.15 3
smoothing 291.53 355.91 4
x+x^2 299.11 361.56 5
sqr(x) 299.15 361.60 6
1/x 303.32 365.76 7
base 379.20 436.84 8
[1] "Smoothing is a semi-parametric and data-driven transformation, please see Wood (2006) for an elaboration"
```

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.