store_fixed_coef: Store fixed effects coefficients

Description Usage Arguments Value See Also Examples

Description

This function extracts the fixed effects coefficients and saves them in a data frame with the number of data points seen so far.

Usage

1

Arguments

object

The sema output, a list containing the model parameters.

Value

A data frame with the number of observations and the fixed effects coefficients

See Also

ranef, store_random_var, store_resid_var

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## First we create a dataset, consisting of 2500 observations from 20 
## units. The fixed effects have the coefficients 1, 2, 3, 4, and 5. The 
## variance of the random effects equals 1, 4, and 9. Lastly the 
## residual variance equals 4:
  
test_data <- build_dataset(n = 2500, 
                           j = 20, 
                           fixed_coef = 1:5, 
                           random_coef_sd = 1:3, 
                           resid_sd = 2)
                           
## Next, we fit a simple model to these data                           
m1 <- sema_fit_df(formula = y ~ 1 + V3 + V4 + V5 + V6 + (1 + V4 + V5 | id), 
                    data_frame = test_data, 
                    intercept = TRUE)
## to subtract the fixed effects from the m1 object:
store_fixed_coef(m1)

L-Ippel/SEMA documentation built on May 30, 2019, 8:23 a.m.