simplify.formula: A function parsing the formula into the vectors of charactor...

View source: R/the_mode_jumping_package5.r View source: R/the_mode_jumping_package4.r View source: R/the_mode_jumping_package4.0.r View source: R/the_mode_jumping_package3.r View source: R/the_mode_jumping_package2.r View source: R/the_mode_jumping_package2.0.r

simplify.formulaR Documentation

A function parsing the formula into the vectors of charactor arrays of responses and covariates

Usage

simplify.formula(fmla,names)

Arguments

fmla

an R formula object

names

all column names from the data.frame to be used with the formula

Value

a list of

fobserved

a vector of charactor arrays corresponding to the observations

fparam

a vector of charactor arrays corresponding to the covariates

See Also

formula, data.frame

Examples

X1<- as.data.frame(array(data = rbinom(n = 50*1000,size = 1,prob = 0.3),dim = c(1000,50)))
Y1=-0.7+1*((1-X1$V1)*(X1$V4)) + 1*(X1$V8*X1$V11)+1*(X1$V5*X1$V9)
X1$Y1<-round(1.0/(1.0+exp(-Y1)))

formula1 = as.formula(paste(colnames(X1)[51],"~ 1 +",paste0(colnames(X1)[-c(51)],collapse = "+")))
names = colnames(X1)
simplify.formula(fmla=formula1,names=names)


aliaksah/EMJMCMC2016 documentation built on July 27, 2023, 5:48 a.m.