Skip to content

Commit f3a3a99

Browse files
New quiz for R with multiple quizes
1 parent a565228 commit f3a3a99

9 files changed

+726
-710
lines changed

individual_modules/advanced_regression_analysis_with_R/advanced_regression_analysis_with_R_extras.ipynb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@
100100
"\n",
101101
"Residuals:\n",
102102
" Min 1Q Median 3Q Max \n",
103-
"-12.723 -2.550 -0.145 2.390 10.545 \n",
103+
"-13.037 -3.102 0.150 3.317 12.093 \n",
104104
"\n",
105105
"Coefficients:\n",
106106
" Estimate Std. Error t value Pr(>|t|) \n",
107-
"(Intercept) 8.34107 0.40980 20.354 <2e-16 ***\n",
108-
"VisitNum -0.09151 0.11334 -0.807 0.420 \n",
109-
"SexM -0.52838 0.55491 -0.952 0.341 \n",
110-
"VisitNum:SexM 0.05683 0.15077 0.377 0.706 \n",
107+
"(Intercept) 9.0482 0.5143 17.593 <2e-16 ***\n",
108+
"VisitNum -0.2658 0.1618 -1.642 0.101 \n",
109+
"SexM -1.1286 0.6934 -1.628 0.104 \n",
110+
"VisitNum:SexM 0.2458 0.2085 1.179 0.239 \n",
111111
"---\n",
112112
"Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1\n",
113113
"\n",
114-
"Residual standard error: 3.957 on 715 degrees of freedom\n",
115-
"Multiple R-squared: 0.003117,\tAdjusted R-squared: -0.001066 \n",
116-
"F-statistic: 0.7451 on 3 and 715 DF, p-value: 0.5254\n"
114+
"Residual standard error: 4.624 on 685 degrees of freedom\n",
115+
"Multiple R-squared: 0.006415,\tAdjusted R-squared: 0.002063 \n",
116+
"F-statistic: 1.474 on 3 and 685 DF, p-value: 0.2203\n"
117117
]
118118
},
119119
"metadata": {},
@@ -162,19 +162,19 @@
162162
"\n",
163163
"Residuals:\n",
164164
" Min 1Q Median 3Q Max \n",
165-
"-12.5021 -2.5515 -0.1623 2.4302 10.6303 \n",
165+
"-13.2979 -3.1486 0.2083 3.3241 12.3776 \n",
166166
"\n",
167167
"Coefficients:\n",
168168
" Estimate Std. Error t value Pr(>|t|) \n",
169-
"(Intercept) 8.05290 0.27629 29.146 <2e-16 ***\n",
170-
"VisitNum:SexF -0.02392 0.08835 -0.271 0.787 \n",
171-
"VisitNum:SexM -0.08852 0.08179 -1.082 0.280 \n",
169+
"(Intercept) 8.42721 0.34536 24.401 <2e-16 ***\n",
170+
"VisitNum:SexF -0.09742 0.12460 -0.782 0.435 \n",
171+
"VisitNum:SexM -0.14319 0.10767 -1.330 0.184 \n",
172172
"---\n",
173173
"Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1\n",
174174
"\n",
175-
"Residual standard error: 3.956 on 716 degrees of freedom\n",
176-
"Multiple R-squared: 0.001853,\tAdjusted R-squared: -0.0009356 \n",
177-
"F-statistic: 0.6644 on 2 and 716 DF, p-value: 0.5149\n"
175+
"Residual standard error: 4.63 on 686 degrees of freedom\n",
176+
"Multiple R-squared: 0.002572,\tAdjusted R-squared: -0.0003362 \n",
177+
"F-statistic: 0.8844 on 2 and 686 DF, p-value: 0.4134\n"
178178
]
179179
},
180180
"metadata": {},
@@ -221,20 +221,20 @@
221221
"\n",
222222
"Residuals:\n",
223223
" Min 1Q Median 3Q Max \n",
224-
"-12.723 -2.550 -0.145 2.390 10.545 \n",
224+
"-13.037 -3.102 0.150 3.317 12.093 \n",
225225
"\n",
226226
"Coefficients:\n",
227227
" Estimate Std. Error t value Pr(>|t|) \n",
228-
"(Intercept) 8.34107 0.40980 20.354 <2e-16 ***\n",
229-
"SexM -0.52838 0.55491 -0.952 0.341 \n",
230-
"SexF:VisitNum -0.09151 0.11334 -0.807 0.420 \n",
231-
"SexM:VisitNum -0.03469 0.09943 -0.349 0.727 \n",
228+
"(Intercept) 9.04816 0.51431 17.593 <2e-16 ***\n",
229+
"SexM -1.12864 0.69338 -1.628 0.104 \n",
230+
"SexF:VisitNum -0.26578 0.16182 -1.642 0.101 \n",
231+
"SexM:VisitNum -0.02001 0.13150 -0.152 0.879 \n",
232232
"---\n",
233233
"Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1\n",
234234
"\n",
235-
"Residual standard error: 3.957 on 715 degrees of freedom\n",
236-
"Multiple R-squared: 0.003117,\tAdjusted R-squared: -0.001066 \n",
237-
"F-statistic: 0.7451 on 3 and 715 DF, p-value: 0.5254\n"
235+
"Residual standard error: 4.624 on 685 degrees of freedom\n",
236+
"Multiple R-squared: 0.006415,\tAdjusted R-squared: 0.002063 \n",
237+
"F-statistic: 1.474 on 3 and 685 DF, p-value: 0.2203\n"
238238
]
239239
},
240240
"metadata": {},

individual_modules/advanced_regression_analysis_with_R/expanding_the_mixed_effects_model_framework.ipynb

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

individual_modules/advanced_regression_analysis_with_R/mixed_effects_models.ipynb

Lines changed: 326 additions & 316 deletions
Large diffs are not rendered by default.

individual_modules/advanced_regression_analysis_with_R/regression_models_with_interaction_terms.ipynb

Lines changed: 78 additions & 78 deletions
Large diffs are not rendered by default.

individual_modules/regression_analysis_with_R/hypothesis_testing.ipynb

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -360,19 +360,19 @@
360360
" }\n",
361361
" }\n",
362362
" </script>\n",
363-
" <div class=\"quiz-question\">Which of these statements are true for the relationship between weight and age? Apply a significance threshold of 0.05. </div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a1\"\n",
364-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a1', 'Correct.', true)\">\n",
365-
" The intercept is significantly non-zero</button><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a2\"\n",
366-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a2', 'Incorrect.', false)\">\n",
367-
" Age is significantly associated with weight</button><div class=\"feedback\" id=\"feedback_quiz_q1\"></div>\n",
363+
" <div class=\"quiz-question\">Which of these statements are true for the relationship between weight and age? Apply a significance threshold of 0.05. </div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1_a1\"\n",
364+
" onclick=\"handleAnswer('quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1_a1', 'Correct.', true)\">\n",
365+
" The intercept is significantly non-zero</button><button type=\"button\" class=\"quiz-answer quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1_a2\"\n",
366+
" onclick=\"handleAnswer('quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1_a2', 'Incorrect.', false)\">\n",
367+
" Age is significantly associated with weight</button><div class=\"feedback\" id=\"feedback_quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q1\"></div>\n",
368368
" <button type=\"submit\" style=\"position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;\">\n",
369369
" Submit\n",
370370
" </button>\n",
371-
" </form><hr><div class=\"quiz-question\">Which of these statements are true for the relationship between BMI and age? Apply a significance threshold of 0.05.</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a1\"\n",
372-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a1', 'Correct.', true)\">\n",
373-
" The intercept is significantly non-zero</button><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a2\"\n",
374-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a2', 'Incorrect.', false)\">\n",
375-
" BMI is significantly associated with weight.</button><div class=\"feedback\" id=\"feedback_quiz_q2\"></div>\n",
371+
" </form><hr><div class=\"quiz-question\">Which of these statements are true for the relationship between BMI and age? Apply a significance threshold of 0.05.</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2_a1\"\n",
372+
" onclick=\"handleAnswer('quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2_a1', 'Correct.', true)\">\n",
373+
" The intercept is significantly non-zero</button><button type=\"button\" class=\"quiz-answer quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2_a2\"\n",
374+
" onclick=\"handleAnswer('quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2_a2', 'Incorrect.', false)\">\n",
375+
" BMI is significantly associated with weight.</button><div class=\"feedback\" id=\"feedback_quiz_c55ec308-6d24-11f0-b070-2675d86bf70a_q2\"></div>\n",
376376
" <button type=\"submit\" style=\"position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;\">\n",
377377
" Submit\n",
378378
" </button>\n",
@@ -720,39 +720,39 @@
720720
" }\n",
721721
" }\n",
722722
" </script>\n",
723-
" <div class=\"quiz-question\">What does the null hypothesis (HO) state in the context of regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a1\"\n",
724-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a1', 'Incorrect', false)\">\n",
725-
" There is a significant relationship between X and Y</button><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a2\"\n",
726-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a2', 'Correct', true)\">\n",
727-
" The coefficient of X is zero</button><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a3\"\n",
728-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a3', 'Incorrect', false)\">\n",
729-
" The coefficient of Y is greater than zero</button><button type=\"button\" class=\"quiz-answer quiz_q1\" id=\"quiz_q1_a4\"\n",
730-
" onclick=\"handleAnswer('quiz_q1', 'quiz_q1_a4', 'Incorrect', false)\">\n",
731-
" The residuals are normally distributed</button><div class=\"feedback\" id=\"feedback_quiz_q1\"></div>\n",
723+
" <div class=\"quiz-question\">What does the null hypothesis (HO) state in the context of regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a1\"\n",
724+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a1', 'Incorrect', false)\">\n",
725+
" There is a significant relationship between X and Y</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a2\"\n",
726+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a2', 'Correct', true)\">\n",
727+
" The coefficient of X is zero</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a3\"\n",
728+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a3', 'Incorrect', false)\">\n",
729+
" The coefficient of Y is greater than zero</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a4\"\n",
730+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1_a4', 'Incorrect', false)\">\n",
731+
" The residuals are normally distributed</button><div class=\"feedback\" id=\"feedback_quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q1\"></div>\n",
732732
" <button type=\"submit\" style=\"position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;\">\n",
733733
" Submit\n",
734734
" </button>\n",
735-
" </form><hr><div class=\"quiz-question\">Which assumption is NOT required for hypothesis testing in regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a1\"\n",
736-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a1', 'Incorrect', false)\">\n",
737-
" Errors (residuals) are normally distributed</button><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a2\"\n",
738-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a2', 'Correct', true)\">\n",
739-
" Samples are dependent</button><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a3\"\n",
740-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a3', 'Incorrect', false)\">\n",
741-
" Variances in each group are equal</button><button type=\"button\" class=\"quiz-answer quiz_q2\" id=\"quiz_q2_a4\"\n",
742-
" onclick=\"handleAnswer('quiz_q2', 'quiz_q2_a4', 'Incorrect', false)\">\n",
743-
" The dependent variable Y has a linear relationship with the independent variable X</button><div class=\"feedback\" id=\"feedback_quiz_q2\"></div>\n",
735+
" </form><hr><div class=\"quiz-question\">Which assumption is NOT required for hypothesis testing in regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a1\"\n",
736+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a1', 'Incorrect', false)\">\n",
737+
" Errors (residuals) are normally distributed</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a2\"\n",
738+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a2', 'Correct', true)\">\n",
739+
" Samples are dependent</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a3\"\n",
740+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a3', 'Incorrect', false)\">\n",
741+
" Variances in each group are equal</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a4\"\n",
742+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2_a4', 'Incorrect', false)\">\n",
743+
" The dependent variable Y has a linear relationship with the independent variable X</button><div class=\"feedback\" id=\"feedback_quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q2\"></div>\n",
744744
" <button type=\"submit\" style=\"position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;\">\n",
745745
" Submit\n",
746746
" </button>\n",
747-
" </form><hr><div class=\"quiz-question\">What does a p-value less than 0.05 indicate in the context of regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_q3\" id=\"quiz_q3_a1\"\n",
748-
" onclick=\"handleAnswer('quiz_q3', 'quiz_q3_a1', 'Incorrect', false)\">\n",
749-
" The null hypothesis cannot be rejected</button><button type=\"button\" class=\"quiz-answer quiz_q3\" id=\"quiz_q3_a2\"\n",
750-
" onclick=\"handleAnswer('quiz_q3', 'quiz_q3_a2', 'Incorrect', false)\">\n",
751-
" There is no significant relationship between the variables</button><button type=\"button\" class=\"quiz-answer quiz_q3\" id=\"quiz_q3_a3\"\n",
752-
" onclick=\"handleAnswer('quiz_q3', 'quiz_q3_a3', 'Correct', true)\">\n",
753-
" The regression coefficient is significantly different from zero</button><button type=\"button\" class=\"quiz-answer quiz_q3\" id=\"quiz_q3_a4\"\n",
754-
" onclick=\"handleAnswer('quiz_q3', 'quiz_q3_a4', 'Incorrect', false)\">\n",
755-
" The residuals are not normally distributed</button><div class=\"feedback\" id=\"feedback_quiz_q3\"></div>\n",
747+
" </form><hr><div class=\"quiz-question\">What does a p-value less than 0.05 indicate in the context of regression analysis?</div><form class=\"quiz-form\"><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a1\"\n",
748+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a1', 'Incorrect', false)\">\n",
749+
" The null hypothesis cannot be rejected</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a2\"\n",
750+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a2', 'Incorrect', false)\">\n",
751+
" There is no significant relationship between the variables</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a3\"\n",
752+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a3', 'Correct', true)\">\n",
753+
" The regression coefficient is significantly different from zero</button><button type=\"button\" class=\"quiz-answer quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3\" id=\"quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a4\"\n",
754+
" onclick=\"handleAnswer('quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3', 'quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3_a4', 'Incorrect', false)\">\n",
755+
" The residuals are not normally distributed</button><div class=\"feedback\" id=\"feedback_quiz_c56fcab8-6d24-11f0-b070-2675d86bf70a_q3\"></div>\n",
756756
" <button type=\"submit\" style=\"position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;\">\n",
757757
" Submit\n",
758758
" </button>\n",

0 commit comments

Comments
 (0)