model1v2p: Modeling function 1v2p

Description Usage Arguments Examples

View source: R/model1v2p.R

Description

This function constructs every possible linear model with one independent variable (y = mx^2 + b) for nx number of dependent variables and testing every independent variable (nx).

Usage

1
2
model1v2p(model.data, ny, nx, CV = F, CV_n = 1, r2random = F,
  runs = 1000)

Arguments

model.data=data.frame

Data.frame that contains both the dependent and independent variables

ny=number

Number of dependent variables to be tested.

nx=number

Number of independent variables to be tested. Do not confuse number of available independent variables with number of independent variables OF THE MODEL.

CV=boolean

T if a cross-validation should be performed, F if not.

CV_n=number

Number of observations to be left out in the cross-validation process. For example CV = T & CV_n = 1 will perform a 1-leave-out-cross-validation, while the same command with CV_n = 2, will performa a 2-leave-out-cross-validation

r2random=boolean

T if an R^2 maximum random distribution should be computed with the data. Calculating this random distribution enables a comparison of the observed R^2 values of the best models with a completely random scenario. This distribution shows if the goodness-of-fit values obtained in the models correspond to a significntly higher value than the expected at random (>= value of percentile 95) or not.

runs=number

Number indicating the number of runs to perform the goodness-of-fit random distribution.

Examples

1
model1v2p(df,ny=9,nx=16)

JonathanVSV/RSModels documentation built on Jan. 24, 2022, 9:24 a.m.