RecursiveNested: RecursiveNested - a recursive function that will calculate...

Description Usage Arguments Examples

View source: R/RecursiveNested.R

Description

This function is used in the fastSWEcalculation.R function to quickly calculate SwE for a nested variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
RecursiveNested(
  iter,
  nests,
  nested,
  datavec,
  Sinit,
  residarray,
  Breadvec,
  npred,
  adjustment,
  X,
  Sb
)

Arguments

iter

The current iteration, when called it should be set to 1.

nests

The range of blocks within the nested design should be ordered in same order as the set of whole numbers (e.g. 1,2,3,4...)

nested

An integer vector denoting the blocks ordered by the input data

datavec

An integer denoting the number of vertices/voxels to be tested

Sinit

The initial covariance structure used by the sandwich estimator, default is a 1xPxdatavec numeric array set to zeros

residarray

The residuals from the initial fit of the model to the voxel/vertex-wide dataset, should be a numeric array of num_casesXnum_voxel/vertices

Breadvec

The "bread" of the sandwich estimator, calculated from the predictor variables P, should be a numeric array of Pxnum_cases

npred

The number of predictors, P. Should be an integer.

S

The covariance structure estimated from the sandwich estimator, updated upon each recursive estimation.

Examples

1
SwE <- RecursiveNested(iter=1,nests=1:Nschool,nested=Ischool,datavec=Nelm,Sinit=S0,residarray=res,Breadvec=BreadX,npred=P,adjustment=adjustment,hat_adjust=hat_adjust,S)

DCAN-Labs/MarginalModelCIFTI documentation built on Nov. 30, 2021, 3:40 p.m.