Selection bias in clinical sciences: Difference between revisions

→‎{{header|Julia}}: remove * 10 on pdosing
m (typo)
(→‎{{header|Julia}}: remove * 10 on pdosing)
Line 73:
elseif rand() < pcovid
subj.had_covid = true
elseif subj.cum_dose > 0 && rand() <= pdosing * 10 || subj.cum_dose == 0 && rand() <= pstart
subj.cum_dose += rand(drange)
subj.treatment_class =
Line 123:
 
Day 30:
Untreated: N = 86718633, with infection = 263 288
Irregular Use: N = 6941367, with infection = 16 21
Regular Use: N = 6350, with infection = 2 0
 
Day 60:
Untreated: N = 75297513, with infection = 505 519
Irregular Use: N = 6202325, with infection = 43 79
Regular Use: N = 1851162, with infection = 40 2
 
Day 90:
Untreated: N = 65836559, with infection = 702 692
Irregular Use: N = 5782362, with infection = 60 159
Regular Use: N = 28391079, with infection = 113 24
 
At midpoint, Infection case percentages are:
Untreated : 10.66455
Irregulars: 106.38 73
Regulars : 32.98 225
 
Day 120:
Untreated: N = 57635794, with infection = 862845
Irregular Use: N = 5262071, with infection = 78221
Regular Use: N = 37112135, with infection = 20872
 
Day 150:
Untreated: N = 51065115, with infection = 986987
Irregular Use: N = 4201835, with infection = 91266
Regular Use: N = 44743050, with infection = 327156
 
Day 180:
Untreated: N = 45524538, with infection = 10991106
Irregular Use: N = 3691654, with infection = 97302
Regular Use: N = 50793808, with infection = 472263
 
At study end, Infection case percentages are:
Untreated : 24.1438 of group size of 45524538
Irregulars: 2618.2827 of group size of 3691654
Regulars : 96.3906 of group size of 50793808
 
 
Line 174:
Test summary:
outcome with 95% confidence: reject h_0
one-sided p-value: <1e-8899
 
Details:
number of observation in each group: [45524538, 3691654, 50793808]
χ²-statistic: 406457.313179
rank sums: [2.44609e744308e7, 28.02244e639891e6, 21.35217e771753e7]
degrees of freedom: 2
adjustment for ties: 0.416933417533
 
Kruskal-Wallis rank sum test (chi-square approximation)
Line 192:
Test summary:
outcome with 95% confidence: reject h_0
one-sided p-value: <1e-8899
 
Details:
number of observation in each group: [45524538, 3691654, 50793808]
χ²-statistic: 406457.313179
rank sums: [2.44609e744308e7, 28.02244e639891e6, 21.35217e771753e7]
degrees of freedom: 2
adjustment for ties: 0.416933417533
</pre>
 
 
=={{header|Python}}==
4,108

edits