Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Please try below:</p> <pre><code>model1 &lt;- lme( Y ~ GROUP + X1, random = ~ GROUP | person, correlation = corCompSymm(form = ~ day | person), na.action = na.exclude, data = df1, method = "REML" ) summary(model1) </code></pre> <p>I think <code>random = ~ groupvar | subjvar</code> option with <code>R</code> <code>lme</code> provides similar result of <code>repeated / subject = subjvar group = groupvar</code> option with <code>SAS/MIXED</code> in this case.</p> <p><strong>Edit:</strong></p> <p>SAS/MIXED</p> <p><img src="https://i.stack.imgur.com/7KMOS.gif" alt="SAS/MIXED covariance matrix"></p> <p>R (a revised model2)</p> <pre><code>model2 &lt;- lme( Y ~ GROUP + X1, random = list(person = pdDiag(form = ~ GROUP - 1)), correlation = corCompSymm(form = ~ day | person), weights = varIdent(form = ~ 1 | GROUP), na.action = na.exclude, data = df1, method = "REML" ) summary(model2) </code></pre> <p><img src="https://i.stack.imgur.com/dmHxk.gif" alt="R covariance matrix"></p> <p>So, I think these covariance structures are very similar (&sigma;<sub>g1</sub> = &tau;<sub>g</sub><sup>2</sup> + &sigma;<sub>1</sub>).</p> <p><strong>Edit 2:</strong> </p> <p>Covariate estimates (SAS/MIXED):</p> <pre><code>Variance person GROUP TEST 8789.23 CS person GROUP TEST 125.79 Variance person GROUP CONTROL 82775 CS person GROUP CONTROL 33297 </code></pre> <p>So </p> <pre><code>TEST group diagonal element = 125.79 + 8789.23 = 8915.02 CONTROL group diagonal element = 33297 + 82775 = 116072 </code></pre> <p>where diagonal element = &sigma;<sub>k1</sub> + &sigma;<sub>k</sub><sup>2</sup>.</p> <p>Covariate estimates (R lme):</p> <pre><code>Random effects: Formula: ~GROUP - 1 | person Structure: Diagonal GROUP1TEST GROUP2CONTROL Residual StdDev: 14.56864 184.692 93.28885 Correlation Structure: Compound symmetry Formula: ~day | person Parameter estimate(s): Rho -0.009929987 Variance function: Structure: Different standard deviations per stratum Formula: ~1 | GROUP Parameter estimates: 1TEST 2CONTROL 1.000000 3.068837 </code></pre> <p>So </p> <pre><code>TEST group diagonal element = 14.56864^2 + (3.068837^0.5 * 93.28885 * -0.009929987) + 93.28885^2 = 8913.432 CONTROL group diagonal element = 184.692^2 + (3.068837^0.5 * 93.28885 * -0.009929987) + (3.068837 * 93.28885)^2 = 116070.5 </code></pre> <p>where diagonal element = &tau;<sub>g</sub><sup>2</sup> + &sigma;<sub>1</sub> + &sigma;<sub>g</sub><sup>2</sup>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload