tips:clogit_paired_binary_data
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tips:clogit_paired_binary_data [2019/07/03 08:12] – external edit 127.0.0.1 | tips:clogit_paired_binary_data [2022/08/03 11:31] (current) – Wolfgang Viechtbauer | ||
---|---|---|---|
Line 12: | Line 12: | ||
ci <- c(rep(0, | ci <- c(rep(0, | ||
di <- 1-ci | di <- 1-ci | ||
- | ### change data to long format | + | ### change data to long format |
event <- c(rbind(ai, | event <- c(rbind(ai, | ||
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 = " | method = " | ||
- | n= 200, number of events= 90 | + | n= 200, number of events= 90 |
- | coef exp(coef) se(coef) | + | coef exp(coef) se(coef) |
group 0.8109 | group 0.8109 | ||
--- | --- | ||
Line 56: | Line 56: | ||
Formula: event ~ group + (1 | id) | Formula: event ~ group + (1 | id) | ||
- | | + | |
- | | + | |
- | Scaled residuals: | + | Scaled residuals: |
- | Min 1Q Median | + | Min 1Q Median |
- | -1.1703 -0.4314 -0.2876 | + | -1.1703 -0.4314 -0.2876 |
Random effects: | Random effects: | ||
| | ||
- | | + | |
Number of obs: 200, groups: | Number of obs: 200, groups: | ||
Fixed effects: | Fixed effects: | ||
- | Estimate Std. Error z value Pr(> | + | Estimate Std. Error z value Pr(>|z|) |
(Intercept) | (Intercept) | ||
group | group | ||
Line 87: | Line 87: | ||
Results: | Results: | ||
<code output> | <code output> | ||
- | Call: glmmML(formula = event ~ group, family = binomial, cluster = id, method = " | + | Call: glmmML(formula = event ~ group, family = binomial, cluster = id, method = " |
Line 94: | Line 94: | ||
group 0.8109 | group 0.8109 | ||
- | Scale parameter in mixing distribution: | + | Scale parameter in mixing distribution: |
- | Std. Error: | + | Std. Error: |
- | 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 | Residual deviance: 247.9 on 197 degrees of freedom | ||
Line 124: | Line 124: | ||
<code rsplus> | <code rsplus> | ||
library(metafor) | library(metafor) | ||
- | rma.glmm(measure=" | + | rma.glmm(measure=" |
</ | </ | ||
<code output> | <code output> | ||
- | Fixed-Effects Model (k = 26) | + | Equal-Effects Model (k = 26) |
Model Type: Conditional Model with Exact Likelihood | Model Type: Conditional Model with Exact Likelihood | ||
Line 136: | Line 136: | ||
Model Results: | Model Results: | ||
- | estimate | + | estimate |
- | 0.8109 | + | 0.8109 |
--- | --- | ||
- | Signif. codes: | + | Signif. codes: |
</ | </ | ||
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