choose.fform: Compare a number of user-specified transformations with a...

Description Usage Arguments Value Author(s) References Examples

Description

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 each transformation, 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

Usage

1
choose.fform(data,base_form,variable,functionList, distribution=gaussian)

Arguments

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

functionList

A list of transformations. Please see the example for an elaboration

distribution

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

Value

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

fforms

The formula provided by the user

Author(s)

Toke Emil Panduro & Cathrine Ulla Jensen

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Test a linear specification (x), a log (I(log(x))) and a square I(x^2))
library(PanJen) 
data("hvidovre")
form<-formula(lprice ~brick+roof_tile+roof_cemen+rebuild90+rebuild00+y7+y8+y9)
fxlist= list(
  linear = function(x) x,
  sqr = function(x) x^2,
  log=function(x) log(x)
)
  
PanJenAreaC<-choose.fform(data=hvidovre,variable="area",base_form=form, functionList=fxlist) 

PanJen documentation built on May 1, 2019, 10:17 p.m.

Related to choose.fform in PanJen...