WS.Corr.Mixed.SAS: Estimate within-subject (test-retest) correlations based on a...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/WS.Corr.Mixed.SAS.R

Description

This function allows for the estimation of the within-subject correlations using a general and flexible modeling approach that allows at the same time to capture hierarchies in the data, the presence of covariates, and the derivation of correlation estimates. The output of proc MIXED (SAS) is used as the input for this function. Confidence intervals for the correlations based on the Delta method are provided.

Usage

1
WS.Corr.Mixed.SAS(Model, D, Sigma2, Asycov, Rho, Tau2, Alpha=0.05, Time)

Arguments

Model

The type of model that should be fitted. Model=1: random intercept model, Model=2: random intercept and serial correlation, and Model=3: random intercept, slope, and serial correlation. Default Model=1.

D

The D matrix of the fitted model.

Sigma2

The residual variance.

Asycov

The asymptotic correlation matrix of covariance parameter estimates.

Rho

The ρ component of the fitted model which determines the matrix H_{i}, ρ(|t_{ij}-t_{ik}|). This component is only needed when serial correlation is involved, i.e., when Model 2 or 3 used.

Tau2

The τ^2 component of the fitted model. This component is only needed when serial correlation is involved (i.e., when Model 2 or 3 used), \varepsilon_{2} \sim N(0, τ^2 H_{i})).

Alpha

The α-level to be used in the computation of the Confidence Intervals around the within-subject correlation. The Confidence Intervals are based on the Delta method. Default Alpha=0.05.

Time

The time points available in the dataset on which the analysis was conducted.

Value

Model

The type of model that was fitted.

R

The estimated within-subject correlations.

Alpha

The α-level used to computed the Confidence Intervals around R.

CI.Upper

The upper bounds of the confidence intervals (Delta-method based).

CI.Lower

The lower bounds of the confidence intervals (Delta-method based).

Time

The time values in the dataset.

Author(s)

Wim Van der Elst, Geert Molenberghs, Ralf-Dieter Hilgers, & Nicole Heussen

References

Van der Elst, W., Molenberghs, G., Hilgers, R., & Heussen, N. (2015). Estimating the reliability of repeatedly measured endpoints based on linear mixed-effects models. A tutorial. Submitted.

See Also

WS.Corr.Mixed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Open data 
data(Example.Data)

# Estimate R and Delta method-based CI 
# based on SAS output of fitted Model 2

# First specify asycov matrix
Asy_mat <- matrix(c(129170, -10248, -12.0814, -74.8605,
                    -10248, 25894, 21.0976, -50.1059,
                    -12.0814, 21.0976, 0.07791, 1.2120,
                    -74.8605, -50.1059, 1.212, 370.65), nrow = 4)
Model2_SAS <-  WS.Corr.Mixed.SAS(Model="Model 2", 
D=500.98, Tau2=892.97, Rho=3.6302, Sigma2=190.09, 
Asycov = Asy_mat, Time=c(1:45))                               
summary(Model2_SAS)
plot(Model2_SAS)

Example output

Loading required package: nlme
Model 2, Random intercept + serial corr (Gaussian):
===================================================

Estimated correlations R as a function of time lag: 
--------------------------------------------------- 
 [1] 0.8388025 0.7324175 0.6010243 0.4836800 0.4008326 0.3529689 0.3299530
 [8] 0.3206520 0.3174743 0.3165527 0.3163253 0.3162774 0.3162688 0.3162675
[15] 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673
[22] 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673
[29] 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673
[36] 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673 0.3162673
[43] 0.3162673 0.3162673 0.3162673

95% confidence intervals (Delta method), lower bounds:
------------------------------------------------------ 
 [1]  0.747668843  0.402858120  0.190899719  0.107820025  0.041708434
 [6]  0.001704681 -0.017873540 -0.025839071 -0.028567129 -0.029358866
[11] -0.029554331 -0.029595480 -0.029602878 -0.029604016 -0.029604165
[16] -0.029604182 -0.029604184 -0.029604184 -0.029604184 -0.029604184
[21] -0.029604184 -0.029604184 -0.029604184 -0.029604184 -0.029604184
[26] -0.029604184 -0.029604184 -0.029604184 -0.029604184 -0.029604184
[31] -0.029604184 -0.029604184 -0.029604184 -0.029604184 -0.029604184
[36] -0.029604184 -0.029604184 -0.029604184 -0.029604184 -0.029604184
[41] -0.029604184 -0.029604184 -0.029604184 -0.029604184 -0.029604184

95% confidence intervals (Delta method), upper bounds:
------------------------------------------------------ 
 [1] 0.8989253 0.8938565 0.8325003 0.7385643 0.6682355 0.6266966 0.6065382
 [8] 0.5983622 0.5955652 0.5947537 0.5945534 0.5945113 0.5945037 0.5945025
[15] 0.5945024 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023
[22] 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023
[29] 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023
[36] 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023 0.5945023
[43] 0.5945023 0.5945023 0.5945023

CorrMixed documentation built on May 2, 2019, 3:26 p.m.