Description Usage Arguments Value See Also Examples
View source: R/lm_hierarch_d.R
Hierarchichal regression with several blocks estimated in sequence
This is basically a wrapper function for lm
that splits the formula
into user denoted blocks and computes its models in order to evaluate the incremental validity of each predictor set.
1 |
formula |
the complete formula including all blocks from the hierarchical regression |
blocks |
numeric vector denoting the length of each block e.g. c(2, 3, 1) meaning 2 predictors then 3 predictors then 1 predictor |
data |
the dataframe holding the variables for the estimation of the lm |
summary |
should the results be summaries of the lm object |
... |
additional parameters for |
list of the regression models
1 2 3 4 5 6 7 8 9 | ## Not run:
# hierarchical regression with 2 blocks, 1:sex, 2: age + school
lm_hierarch(conscien ~ sex + age + school, c(1),data=neoffi)
## End(Not run)
# 4 blocks with each time one additional predictor
lm_hierarch_d(formula=mpg ~ disp + hp + wt + drat, blocks=c(1,1,1,1), summary=TRUE, data=mtcars)
# 2 blocks with each time 2 additional predictors
lm_hierarch_d(mpg ~ disp + hp + wt + drat, c(2,2), data=mtcars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.