build_theta_j: Sema unit list

Description Usage Arguments Value Examples

Description

This function creates a list with objects required at the unit level

Usage

1
build_theta_j(n_fixed, n_random, ids)

Arguments

n_fixed

The number of fixed effects.

n_random

The number of random effects.

ids

The id label.

Value

A list containing the following objects per individual: id label id; the number of observations of this unit, n_j; the square matrix for the data of the fixed effects covariates, x_sq; the sum of the squared response, y_sq; the product of the fixed effects covariates with the reponse, xy, a row vector; the square matrix for the data of the random effects covariates z_sq; the product of fixed effects covariates and random effects covariates zx_mat, dimensions: number of fixed effects x number of random effects; the product of random effects covariates and dependent variable zy, a row vector.

Examples

1
2
3
4
5
6
7
## We create a list with objects used by the sema_fit functions
## when this function is used outside the sema_fit functions, ids, 
## which is the identifying label must be given 
 
unit_statistics <- build_theta_j(n_fixed = 5,
                                  n_random = 3,
                                  ids = 1)

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