PWIGLS_ALL: Probability-weighted iterative generalized least squares...

Description Usage Arguments Details Value Options for variable type Author(s) References See Also Examples

View source: R/PWIGLS_ALL.r

Description

Calculate trend from data collected with complex survey designs by incorporating weights with a linear mixed model. This is an internal function called from TrendNPS_Cont.

Usage

1
PWIGLS_ALL(Z, dat, stage1wt, stage2wt, type, stratum, slope)

Arguments

Z

Random-effects design matrix from the unweighted (PO) model.

dat

Data frame containing columns at least for Site, WYear, Year, and the continuous outcome of interest Y. See section "Data frame dat" below.

stage1wt

Design weights from the original sample draw without accounting for temporal revisit designs.

stage2wt

Panel inclusion weights for each site each year.

type

Scaling type when method="PWIGLS". Valid values include "Aonly", "A", "AI", "B", "BI" "C". See section "Options for variable type" below.

stratum

Text string identifying an optional two-level stratification factor in dat. Use stratum = NA to indicate no stratification used.

slope

Logical value indicating inclusion of a random site-level slope effect in the variance components structure in addition to the Site- and Year- level random intercept terms. Default = TRUE.

Details

Calculates the probability-weighted iterative generalized least squares (PWIGLS) trend model (Pfeffermann et al. 1998; Asparouhov 2006).

Value

Returns a vector of regression coefficient estimates for the trend model.

Options for variable type

Selection of method="PWIGLS" requires further specification of argument type. Valid options include

"Aonly" Probability weighting but no scaling at either stage
"A" Panel-weights scaling with mean site-level design weight
"AI" Panel-weights scaling with mean site-level design weight, but no site-level scaling
"B" Panel-weights scaling with effective mean site-level design weight
"BI" Panel-weights scaling with effective mean site-level design weight, but no site-level scaling
"C" Year-level scaling only with inverse of the average year-level weight

Author(s)

Leigh Ann Starcevich of Western EcoSystems Technology, Inc.

References

Asparouhov, T. (2006). General multi-level modeling with sampling weights. Communications in Statistics - Theory and Methods 35: 439-460.

Pfeffermann, D., C.J. Skinner, D.J. Holmes, H. Goldstein, and J. Rasbash (1998). Weighting for unequal selection probabilities in multilevel models. Journal of the Royal Statistical Society, Series B 60(1): 23-40.

See Also

TrendNPS_Cont, LinearizationVar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
#  ---- Read example data set.
	fit<-PWIGLS_ALL(Z=getME(fit_PO,"Z"),
	                dat=dat,
	                stage1wt=stage1wt,
	                stage2wt=stage2wt,
	                type=type,
                 stratum=stratum,
                 slope=slope)

## End(Not run)

LAStarcevich/TrendNPS documentation built on May 21, 2019, 9:19 a.m.