## [1] "patientname" "lastfour"
## [3] "patientsid" "gender"
## [5] "CysCLabDate" "correctedage...6"
## [7] "LabChemResultValue...7" "CysCeGFR"
## [9] "ScrLabDate" "correctedage...10"
## [11] "LabChemResultValue...11" "ScreGFR"
## [13] "eGFRDifference" "Smoking"
## [15] "BMI"
eGFRDifference = CysCeGFR - ScreGFR
## correctedage...6 BMI CysCeGFR ScreGFR
## Min. : 20.00 Min. :14.14 Min. : 7.796 Min. : 4.627
## 1st Qu.: 62.00 1st Qu.:27.54 1st Qu.: 23.818 1st Qu.: 38.629
## Median : 73.00 Median :33.51 Median : 37.938 Median : 57.287
## Mean : 69.13 Mean :34.34 Mean : 42.954 Mean : 62.468
## 3rd Qu.: 78.00 3rd Qu.:40.83 3rd Qu.: 57.010 3rd Qu.: 85.361
## Max. :101.00 Max. :97.60 Max. :121.296 Max. :154.002
## eGFRDifference
## Min. :-101.82
## 1st Qu.: -28.26
## Median : -17.28
## Mean : -19.51
## 3rd Qu.: -10.45
## Max. : 36.12
##
## Group 1A Group 1B Group 2A Group 2B
## 1578 73 0 19
##
## Group 1A Group 1B Group 2A Group 2B
## 0.94491018 0.04371257 0.00000000 0.01137725
Body Mass Index (BMI) is categorized as: Underweight (< 18.5), Normal weight (18.5–24.9), Overweight (25.0–29.9), and Obese (30.0 or higher)
| Characteristic | Group 1A N = 1,5781 |
Group 1B N = 731 |
Group 2A N = 01 |
Group 2B N = 191 |
p-value2 |
|---|---|---|---|---|---|
| gender | 0.3 | ||||
| Â Â Â Â F | 185 (12%) | 8 (11%) | 0 (NA%) | 0 (0%) | |
| Â Â Â Â M | 1,393 (88%) | 65 (89%) | 0 (NA%) | 19 (100%) | |
| Smoking | 0.2 | ||||
| Â Â Â Â CURRENT | 213 (13%) | 8 (11%) | 0 (NA%) | 2 (11%) | |
| Â Â Â Â FORMER | 755 (48%) | 29 (40%) | 0 (NA%) | 6 (32%) | |
| Â Â Â Â NEVER | 610 (39%) | 36 (49%) | 0 (NA%) | 11 (58%) | |
| bmi_group | 0.2 | ||||
| Â Â Â Â Normal | 82 (12%) | 8 (23%) | 0 (NA%) | 0 (0%) | |
| Â Â Â Â Obese | 456 (65%) | 21 (60%) | 0 (NA%) | 5 (83%) | |
| Â Â Â Â Overweight | 164 (23%) | 5 (14%) | 0 (NA%) | 1 (17%) | |
| Â Â Â Â Underweight | 4 (0.6%) | 1 (2.9%) | 0 (NA%) | 0 (0%) | |
| 1 n (%) | |||||
| 2 Fisher’s exact test | |||||
Reults: At least one mean is different. In the multiple comparison of means, all pairs of means are significantly different. In this case, since Group 2A has 0 observations, this test for means of eGFR differences among Group 1A, Group 1B, and Group 2B.
## Df Sum Sq Mean Sq F value Pr(>F)
## eGFRGroup 2 111083 55541 353.1 <2e-16 ***
## Residuals 1667 262218 157
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = eGFRDifference ~ eGFRGroup, data = anova_data)
##
## $eGFRGroup
## diff lwr upr p adj
## Group 1B-Group 1A 30.80464 27.28244 34.32683 0
## Group 2B-Group 1A 50.23909 43.44899 57.02920 0
## Group 2B-Group 1B 19.43446 11.85723 27.01168 0
This tests if the mean BMI’s are different for 3 eGFR groups. Results: No significant differences in mean BMI among different groups.
## Df Sum Sq Mean Sq F value Pr(>F)
## eGFRGroup 2 210 105.18 1.432 0.239
## Residuals 744 54629 73.43
## 923 observations deleted due to missingness
This tests if the mean ages are different for 3 eGFR groups. Results: At least one mean age is different among the groups.
## Df Sum Sq Mean Sq F value Pr(>F)
## eGFRGroup 2 17147 8573 40.57 <2e-16 ***
## Residuals 1667 352247 211
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
This tests to see if the gender and the eGFR group are associated or not. This can’t be tested since there are 0’s in the categories.
##
## Group 1A Group 1B Group 2A Group 2B
## F 185 8 0 0
## M 1393 65 0 19
##
## Pearson's Chi-squared test
##
## data: gender_table
## X-squared = NaN, df = 3, p-value = NA
This tests to see if the smoking and the eGFR group are associated or not. Cannot be tested because of 0’s.
##
## Group 1A Group 1B Group 2A Group 2B
## CURRENT 213 8 0 2
## FORMER 755 29 0 6
## NEVER 610 36 0 11
##
## Pearson's Chi-squared test
##
## data: smoking_table
## X-squared = NaN, df = 6, p-value = NA
We fit the model with outcome variable eGFRDifference against the variables: age, gender, BMI, smoking. Results: All variables are highly significant. However, we cannot rely on this model since the model fit is poor.
##
## Call:
## lm(formula = eGFRDifference ~ correctedage...6 + gender + BMI +
## Smoking, data = reg_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -87.023 -7.710 1.788 8.359 53.783
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.35051 4.42195 -0.984 0.325513
## correctedage...6 -0.11357 0.04272 -2.658 0.008025 **
## genderM 6.24007 1.86541 3.345 0.000864 ***
## BMI -0.49240 0.06717 -7.331 6e-13 ***
## SmokingFORMER 4.05322 1.64302 2.467 0.013853 *
## SmokingNEVER 5.19722 1.68242 3.089 0.002082 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 14.13 on 741 degrees of freedom
## (923 observations deleted due to missingness)
## Multiple R-squared: 0.08589, Adjusted R-squared: 0.07972
## F-statistic: 13.92 on 5 and 741 DF, p-value: 5.024e-13
| term | estimate | std.error | statistic | p.value | conf.low | conf.high |
|---|---|---|---|---|---|---|
| (Intercept) | -4.351 | 4.422 | -0.984 | 0.326 | -13.032 | 4.331 |
| correctedage…6 | -0.114 | 0.043 | -2.658 | 0.008 | -0.197 | -0.030 |
| genderM | 6.240 | 1.865 | 3.345 | 0.001 | 2.578 | 9.902 |
| BMI | -0.492 | 0.067 | -7.331 | 0.000 | -0.624 | -0.361 |
| SmokingFORMER | 4.053 | 1.643 | 2.467 | 0.014 | 0.828 | 7.279 |
| SmokingNEVER | 5.197 | 1.682 | 3.089 | 0.002 | 1.894 | 8.500 |
In this model, the outcome variable is eGFRGroup: Group 1A, Group 1B,
Group 2B.
This is different model than Linear Regression. Results: all variables
are significant. The baseline model is Group 1A.
We can examine the odd ratios. For instance, for every 1-unit increase
in BMI, the odds of being in Group 1B rather than Group 1A are estimated
to increase by a factor of exp(0.906) = 2.474, holding all other
variables fixed.
## # weights: 21 (12 variable)
## initial value 820.663380
## iter 10 value 268.194624
## iter 20 value 183.106181
## iter 30 value 152.974601
## final value 152.858401
## converged
## Call:
## multinom(formula = eGFRGroup ~ correctedage...6 + gender + BMI +
## Smoking, data = multi_data)
##
## Coefficients:
## (Intercept) correctedage...6 genderM BMI SmokingFORMER
## Group 1B 2.909255 -0.06692533 0.8842306 -0.09870523 0.790111
## Group 2B -12.300964 -0.07205580 7.6232867 -0.06884902 7.454417
## SmokingNEVER
## Group 1B 1.301076
## Group 2B 6.958546
##
## Std. Errors:
## (Intercept) correctedage...6 genderM BMI SmokingFORMER
## Group 1B 1.468054 0.01200439 0.6532557 0.02659680 0.6696008
## Group 2B 1.019340 0.02285097 1.0209226 0.05467945 0.6330254
## SmokingNEVER
## Group 1B 0.6572652
## Group 2B 0.7275093
##
## Residual Deviance: 305.7168
## AIC: 329.7168
| y.level | term | estimate | std.error | statistic | p.value | conf.low | conf.high |
|---|---|---|---|---|---|---|---|
| Group 1B | (Intercept) | 18.343 | 1.468 | 1.982 | 0.048 | 1.032 | 325.899 |
| Group 1B | correctedage…6 | 0.935 | 0.012 | -5.575 | 0.000 | 0.914 | 0.958 |
| Group 1B | genderM | 2.421 | 0.653 | 1.354 | 0.176 | 0.673 | 8.711 |
| Group 1B | BMI | 0.906 | 0.027 | -3.711 | 0.000 | 0.860 | 0.954 |
| Group 1B | SmokingFORMER | 2.204 | 0.670 | 1.180 | 0.238 | 0.593 | 8.187 |
| Group 1B | SmokingNEVER | 3.673 | 0.657 | 1.980 | 0.048 | 1.013 | 13.320 |
| Group 2B | (Intercept) | 0.000 | 1.019 | -12.068 | 0.000 | 0.000 | 0.000 |
| Group 2B | correctedage…6 | 0.930 | 0.023 | -3.153 | 0.002 | 0.890 | 0.973 |
| Group 2B | genderM | 2045.273 | 1.021 | 7.467 | 0.000 | 276.529 | 15127.330 |
| Group 2B | BMI | 0.933 | 0.055 | -1.259 | 0.208 | 0.839 | 1.039 |
| Group 2B | SmokingFORMER | 1727.476 | 0.633 | 11.776 | 0.000 | 499.551 | 5973.711 |
| Group 2B | SmokingNEVER | 1052.102 | 0.728 | 9.565 | 0.000 | 252.814 | 4378.395 |