Description Usage Arguments Value Author(s) Examples
View source: R/contselec-package8.R
This function conducts stepwise model selection, using the best model selected by "selec_bestsub" as the initial model.
1 | selec_stepwise(result, data0, edge_param_number, family, scale01 = FALSE)
|
result |
data.frame : result output of "selec_bestsub" |
data0 |
data.frame : explained variable "y" and uncontracted explanatory variables. |
edge_param_number |
real number: this parameter constrains the number of explanatory variables in the subset model selection and stepwise model selection, so that [sample size]/[number of free parameter] >= "edge_param_number". |
family |
character : error distribution. Possible choices are "glmm_poisson", "poisson","gaussian". |
scale01 |
TRUE/FALSE : if TRUE, explanatory variables are scaled in advance so that their ranges are from 0 to 1. |
list(result=result,bestmodel=bestmodel)
Hiroshi C. Ito
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(Cars93, package = "MASS");
data=Cars93;
data=data[complete.cases(data),];
data=data[,sapply(data[1,],is.numeric)];
con=contract(data,edge_cor=0.9,edge_explain=0.6,target="Horsepower");
data1=con$data1;
for(i in 2:ncol(data1))data1[,i]=(data1[,i]-min(data1[,i]))/(max(data1[,i])-min(data1[,i]));
res_sb=selec_bestsub(con$data0,data1,con$group,edge_param_number=3,repeatn=50,family="gaussian",target=con$target, use_pforeach=FALSE,perm=TRUE,daic=2.0);
print(res_sb$result);
res_ss=selec_stepwise(res_sb$result,con$data0,edge_param_number=3,family=res_sb$bestmodel$family,scale01=TRUE);
print(put_sigmark(res_ss$result));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.