The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


tips:clogit_paired_binary_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tips:clogit_paired_binary_data [2021/11/08 13:08] Wolfgang Viechtbauertips:clogit_paired_binary_data [2022/08/03 11:31] (current) Wolfgang Viechtbauer
Line 12: Line 12:
 ci <- c(rep(0,42), rep(1,8), rep(0,18), rep(1,32)) ci <- c(rep(0,42), rep(1,8), rep(0,18), rep(1,32))
 di <- 1-ci di <- 1-ci
-### change data to long format +### change data to long format
 event <- c(rbind(ai,ci)) event <- c(rbind(ai,ci))
 group <- rep(c(1,0), times=n) group <- rep(c(1,0), times=n)
Line 26: Line 26:
 <code output> <code output>
 Call: Call:
-coxph(formula = Surv(rep(1, 200L), event) ~ group + strata(id), +coxph(formula = Surv(rep(1, 200L), event) ~ group + strata(id),
     method = "exact")     method = "exact")
  
-  n= 200, number of events= 90 +  n= 200, number of events= 90
  
-        coef exp(coef) se(coef)     z Pr(>|z|)  +        coef exp(coef) se(coef)     z Pr(>|z|)
 group 0.8109    2.2500   0.4249 1.908   0.0563 . group 0.8109    2.2500   0.4249 1.908   0.0563 .
 --- ---
Line 56: Line 56:
 Formula: event ~ group + (1 | id) Formula: event ~ group + (1 | id)
  
-     AIC      BIC   logLik deviance df.resid  +     AIC      BIC   logLik deviance df.resid 
-   253.9    263.8   -124.0    247.9      197 +   253.9    263.8   -124.0    247.9      197
  
-Scaled residuals:  +Scaled residuals: 
-    Min      1Q  Median      3Q     Max  +    Min      1Q  Median      3Q     Max 
--1.1703 -0.4314 -0.2876  0.5031  1.2817 +-1.1703 -0.4314 -0.2876  0.5031  1.2817
  
 Random effects: Random effects:
  Groups Name        Variance Std.Dev.  Groups Name        Variance Std.Dev.
- id     (Intercept) 7.207    2.685   + id     (Intercept) 7.207    2.685
 Number of obs: 200, groups:  id, 100 Number of obs: 200, groups:  id, 100
  
 Fixed effects: Fixed effects:
-            Estimate Std. Error z value Pr(>|z|)  +            Estimate Std. Error z value Pr(>|z|)
 (Intercept)  -0.8110     0.4255  -1.906   0.0566 . (Intercept)  -0.8110     0.4255  -1.906   0.0566 .
 group         0.8109     0.4249   1.908   0.0563 . group         0.8109     0.4249   1.908   0.0563 .
Line 87: Line 87:
 Results: Results:
 <code output> <code output>
-Call:  glmmML(formula = event ~ group, family = binomial, cluster = id,      method = "ghq", n.points = 17) +Call:  glmmML(formula = event ~ group, family = binomial, cluster = id,      method = "ghq", n.points = 17)
  
  
Line 94: Line 94:
 group        0.8109   0.4249  1.908   0.0563 group        0.8109   0.4249  1.908   0.0563
  
-Scale parameter in mixing distribution:  2.685 gaussian  +Scale parameter in mixing distribution:  2.685 gaussian 
-Std. Error:                              0.661 +Std. Error:                              0.661
  
-        LR p-value for H_0: sigma = 0:  2.461e-07 +        LR p-value for H_0: sigma = 0:  2.461e-07
  
 Residual deviance: 247.9 on 197 degrees of freedom      AIC: 253.9 Residual deviance: 247.9 on 197 degrees of freedom      AIC: 253.9
Line 132: Line 132:
 Tests for Heterogeneity: Tests for Heterogeneity:
 Wld(df = 25) =      NA, p-val = NA Wld(df = 25) =      NA, p-val = NA
-LRT(df = 25) = 32.0966, p-val = 0.1552                                                                                   +LRT(df = 25) = 32.0966, p-val = 0.1552
  
 Model Results: Model Results:
  
-estimate      se    zval    pval    ci.lb   ci.ub  +estimate      se    zval    pval    ci.lb   ci.ub 
-  0.8109  0.4249  1.9085  0.0563  -0.0219  1.6437 +  0.8109  0.4249  1.9085  0.0563  -0.0219  1.6437  .
  
 --- ---
Line 143: Line 143:
 </code> </code>
 Results again match what we obtained above. Results again match what we obtained above.
 +
tips/clogit_paired_binary_data.txt · Last modified: 2022/08/03 11:31 by Wolfgang Viechtbauer