-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut2_question8.Rmd
More file actions
59 lines (45 loc) · 2.45 KB
/
Copy pathtut2_question8.Rmd
File metadata and controls
59 lines (45 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
```{r sampling}
#| echo: false
#| results: hide
library(exams)
library(exams2forms)
MMILabData = read.csv("MMILabData.csv", header = T, stringsAsFactors = T, na.strings = " ")
MMILabData = MMILabData[-154,]
MMILabData = na.omit(MMILabData)
lm_results = summary(lm(MMILabData$LengthLeftFoot ~ MMILabData$Sex))
```
Question
========
1. **How much of the variation in LengthLeftFoot can be predicted by Sex? Round to nearest whole number.**
::: {style="padding-left: 2em;"}
`r add_cloze(round(lm_results[["adj.r.squared"]]*100))`
:::
2. **What is the probability that we would have observed an association of this magnitude if the null hypothesis were correct?**
::: {style="padding-left: 2em;"}
`r add_cloze(c("2.2e-16" = FALSE, "> 2.2e-16" = FALSE, "< 2.2e-16" = TRUE), type = "schoice")`
:::
3. **What is the intercept for the regression analysis between LengthLeftFoot and Sex?**
::: {style="padding-left: 2em;"}
`r add_cloze(lm_results[["coefficients"]][1])`
:::
4. **Use the results of the regression analysis to produce a formula for predicting LengthLeftFoot dependent on Sex.**
::: {style="padding-left: 2em;"}
Length of the left foot = `r add_cloze(lm_results[["coefficients"]][1])` (+ `r add_cloze(lm_results[["coefficients"]][2])`if male) cm
:::
5. **What is the likely cause and effect relationship between LengthLeftFoot and Sex?**
::: {style="padding-left: 2em;"}
`r add_cloze(c("Length of the left foot drives differences in sex" = FALSE, "Sex is fully responsible for the length of the left foot" = FALSE, "Sex accounts for some variation in the length of the foot length, but is not the only reason" = TRUE), type = "schoice")`
:::
6. **If we wanted to justify our answer, what could we say?**
::: {style="padding-left: 2em;"}
`r add_cloze(c("The p-value is less than 0.05, therefore sex is fully responsible for differences in the length of the left foot" = FALSE, "It's partially responsible, biological sex is defined by presence of the SRY gene on the Y-chromosome - so sex and the left foot length are likely both independent outcomes from the presence of SRY" = TRUE, "It's unlikely that sex influences the length of the left foot" = FALSE), type = "schoice")`
:::
`r format_metainfo("answerlist")`
Metainformation
===============
exname: penguins sex dimorphism
extype: cloze
exclozetype: `r format_metainfo("type")`
exsolution: `r format_metainfo("solution")`
extol: `r format_metainfo("tolerance")`
exshuffle: TRUE