Pro
What Pro generates: an example
One worked example with made-up study details: a drug against a placebo, a yes/no complication as the outcome, adjusted for age and diabetes. You get the same four things for your own study.
1. The details you fill in
- Study design
- Randomized controlled trial
- Method
- Logistic regression
- Outcome
complication(postoperative complications)- Group
treatment(the drug group and the placebo group)- Covariates
age,diabetes
2. The methods paragraph
The association between the drug group and the placebo group and postoperative complications was estimated with logistic regression, adjusted for age and diabetes. Results are reported as odds ratios with 95% confidence intervals. A two-sided p-value below 0.05 was considered statistically significant. Analyses were performed in R version 4.4.1.
3. The reporting checklist
For an RCT, following CONSORT.
- Statistical test or model named and justified for each outcome
- Subgroup and adjusted analyses stated
- How missing data were handled
- Sample size calculation
- Analysis population (intention-to-treat or per-protocol)
- Effect size with 95% confidence interval for each outcome
- Absolute and relative effect sizes for binary outcomes
4. The R script
# complication_logistic_regression.R
# Generated by statforclinicians Check every step against your own data.
library(tidyverse)
library(broom)
d <- read_csv("trial.csv")
# 1. Check the outcome and covariates
summary(d[, c("complication", "treatment", "age", "diabetes")])
table(d$complication, useNA = "ifany")
# 2. Fit the logistic regression
fit <- glm(complication ~ treatment + age + diabetes,
family = binomial, data = d)
# 3. Odds ratios with 95% CI
tidy(fit, exponentiate = TRUE, conf.int = TRUE)
Reading the result: The "estimate" column holds the odds ratios. The row for treatment is the effect of group, adjusted for age and diabetes.
5. The same analysis as SPSS syntax
* complication_logistic_regression.sps.
* Generated by statforclinicians Check every step against your own data.
* Open your data file in SPSS first. The variable names must match the Variable View.
* Logistic regression with odds ratios and 95% confidence intervals (Exp(B)).
* If the main factor is categorical with more than two categories, add the line
* /CATEGORICAL=treatment and a /CONTRAST line, or make dummy variables.
LOGISTIC REGRESSION VARIABLES complication
/METHOD=ENTER treatment age diabetes
/PRINT=CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).
Reading the result: In the Variables in the Equation table, the column Exp(B) holds the odds ratios with their 95% confidence intervals. The row for treatment is the effect of the group, adjusted for age and diabetes.
Want this for your own study?
Pro costs €10 per month. The free chooser, method pages, glossary and sample size guide never need a key.
Generated text is a draft: check it against your own analysis. See the terms.