View source: R/effectTypesVector.r
| effectTypesVector | R Documentation |
Extracts the vector of estimated effect types from a gamselBayes() fit object.
effectTypesVector(fitObject)
fitObject |
|
The result is a vector of character strings having the same length as the total number of predictors inputted through Xlinear and Xgeneral. The character strings are one of "linear", "nonlinear" and "zero" according to whether each predictor is estimated as having a linear effect, nonlinear effect of zero effect. The ordering in the returned vector matches that of the columns of Xlinear and then the columns of Xgeneral.
A vector of character strings having the same length as the number of predictors, which conveys the estimated effect types.
Virginia X. He virginia.x.he@student.uts.edu.au and Matt P. Wand matt.wand@uts.edu.au
library(gamselBayes)
# Generate some simple regression-type data:
set.seed(1) ; n <- 1000 ; x1 <- rbinom(n,1,0.5) ;
x2 <- runif(n) ; x3 <- runif(n) ; x4 <- runif(n)
y <- x1 + sin(2*pi*x2) - x3 + rnorm(n)
Xlinear <- data.frame(x1) ; Xgeneral <- data.frame(x2,x3,x4)
# Obtain a gamselBayes() fit for the data:
fit <- gamselBayes(y,Xlinear,Xgeneral)
# Obtain the vector of effect types:
effectTypesVector(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.