Scientists claim that there is a possible relationship between the severity of Covid-19 and a low level of blood vitamin D. The normal level for vitamin D is around 30ng/ml. For this reason, the vitamin D blood level has been measured for 2 countries, A and B, and recorded in a Microsoft Excel file (Vitamin D.xlsx). Enter this Excel file into the statistical package of your choice and answer all questions: (Please add the code and output to your answers.) a) Find the number of observations, mean, standard deviation of vitamin D level for the variables Country, Gender, and Sun_Exposure using the statistical package of your choice: b) Write down the statistical hypotheses for three separate analyses comparing the means of the groups in the following variables: (1) Country, (2) Gender, and (3) Sun_Exposure. Estimate the treatment effects for each of these three factors. Note: For the next questions, use a statistical software to randomly sample 30 observations for each Country, and save this subset of observations in a new dataset called "Question_1_Country". In SPSS: Data > Select Cases > Random sample of cases (you can save the random observations as a .sav or an excel file, if using SPSS). In R: you can use the following code to perform this random sampling. Learn this procedure as you may need to use it for other sections. Note: every time you run the following code, you will get a different dataset. Therefore, you will get different outputs (because of the random nature of random sampling). ### 30 Random observations for Country A ### Country A <- subset (Vitamin D, subset= Country="A") C.A - Country A[sample (nrow(Country_A), 30),] ### 30 Random observations for Country B ##* Country B <- subset (Vitamin D, subset= Country="B") C.B < Country B[sample (nrow(Country B),30),]
Scientists claim that there is a possible relationship between the severity of Covid-19 and a low level of blood vitamin D. The normal level for vitamin D is around 30ng/ml. For this reason, the vitamin D blood level has been measured for 2 countries, A and B, and recorded in a Microsoft Excel file (Vitamin D.xlsx). Enter this Excel file into the statistical package of your choice and answer all questions: (Please add the code and output to your answers.) a) Find the number of observations, mean, standard deviation of vitamin D level for the variables Country, Gender, and Sun_Exposure using the statistical package of your choice: b) Write down the statistical hypotheses for three separate analyses comparing the means of the groups in the following variables: (1) Country, (2) Gender, and (3) Sun_Exposure. Estimate the treatment effects for each of these three factors. Note: For the next questions, use a statistical software to randomly sample 30 observations for each Country, and save this subset of observations in a new dataset called "Question_1_Country". In SPSS: Data > Select Cases > Random sample of cases (you can save the random observations as a .sav or an excel file, if using SPSS). In R: you can use the following code to perform this random sampling. Learn this procedure as you may need to use it for other sections. Note: every time you run the following code, you will get a different dataset. Therefore, you will get different outputs (because of the random nature of random sampling). ### 30 Random observations for Country A ### Country A <- subset (Vitamin D, subset= Country="A") C.A - Country A[sample (nrow(Country_A), 30),] ### 30 Random observations for Country B ##* Country B <- subset (Vitamin D, subset= Country="B") C.B < Country B[sample (nrow(Country B),30),]
MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
Related questions
Question
![Scientists claim that there is a possible relationship between the severity of Covid-19 and a
low level of blood vitamin D. The normal level for vitamin D is around 30ng/ml. For this reason,
the vitamin D blood level has been measured for 2 countries, A and B, and recorded in a
Microsoft Excel file (Vitamin_D.xlsx). Enter this Excel file into the statistical package of your
choice and answer all questions: (Please add the code and output to your answers.)
a) Find the number of observations, mean, standard deviation of vitamin D level for
the variables Country, Gender, and Sun_Exposure using the statistical package of your
choice:
b) Write down the statistical hypotheses for three separate analyses comparing
the means of the groups in the following variables: (1) Country,
(2) Gender, and (3) Sun_Exposure.
Estimate the treatment effects for each of these three factors.
Note: For the next questions, use a statistical software to randomly sample 30
observations for each Country, and save this subset of observations in a new dataset
called "Question_1_Country".
In SPSS: Data > Select Cases > Random sample of cases (you can save the random
observations as a .sav or an excel file, if using SPSS).
In R: you can use the following code to perform this random sampling. Learn this
procedure as you may need to use it for other sections.
Note: every time you run the following code, you will get a different dataset.
Therefore, you will get different outputs (because of the random nature of random
sampling).
### 30 Random observations for Country A ##*
Country A <- subset (Vitamin D, subset= Country="A")
C.A - Country A[sample(nrow(Country A), 30),]
-"A")
### 30 Random observations for Country B ###
Country B <- subset (vitamin D, subset=Country="B")
C.B <- Country_B[sample(nrow(Country_B), 30),]
### Combining them in a new dataset ###
Question 1 Country <- rbind (C.A, C.B)
View(Question_1_Country)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F17176ae9-b253-442d-89f9-517b049b4c59%2Fbd8494e4-d7f7-40ee-aa4f-5d97b2cb3bc1%2F0xnw3yr_processed.png&w=3840&q=75)
Transcribed Image Text:Scientists claim that there is a possible relationship between the severity of Covid-19 and a
low level of blood vitamin D. The normal level for vitamin D is around 30ng/ml. For this reason,
the vitamin D blood level has been measured for 2 countries, A and B, and recorded in a
Microsoft Excel file (Vitamin_D.xlsx). Enter this Excel file into the statistical package of your
choice and answer all questions: (Please add the code and output to your answers.)
a) Find the number of observations, mean, standard deviation of vitamin D level for
the variables Country, Gender, and Sun_Exposure using the statistical package of your
choice:
b) Write down the statistical hypotheses for three separate analyses comparing
the means of the groups in the following variables: (1) Country,
(2) Gender, and (3) Sun_Exposure.
Estimate the treatment effects for each of these three factors.
Note: For the next questions, use a statistical software to randomly sample 30
observations for each Country, and save this subset of observations in a new dataset
called "Question_1_Country".
In SPSS: Data > Select Cases > Random sample of cases (you can save the random
observations as a .sav or an excel file, if using SPSS).
In R: you can use the following code to perform this random sampling. Learn this
procedure as you may need to use it for other sections.
Note: every time you run the following code, you will get a different dataset.
Therefore, you will get different outputs (because of the random nature of random
sampling).
### 30 Random observations for Country A ##*
Country A <- subset (Vitamin D, subset= Country="A")
C.A - Country A[sample(nrow(Country A), 30),]
-"A")
### 30 Random observations for Country B ###
Country B <- subset (vitamin D, subset=Country="B")
C.B <- Country_B[sample(nrow(Country_B), 30),]
### Combining them in a new dataset ###
Question 1 Country <- rbind (C.A, C.B)
View(Question_1_Country)

Transcribed Image Text:Country Gender Sun_Exposure Age
Female High
Female High
High
High
High
High
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
Female
Female
Female
Female
Female
High
Female High
Female
High
Female High
Female
High
Female
High
Female High
Female High
Female
Female
High
High
Female
High
Female Low
Female Low
Female
Low
Female
Low
Female Low
Female Low
Female Low
Female
Low
Female
Low
Female Low
Female Low
Female
Low
Female Low
Female
Low
Female Low
Female
Low
Female
Low
Female
Female
Female
Female
Moderate
Moderate
Moderate
Moderate
Female Moderate
Female
Moderate
Female
Moderate
Female
Moderate
Female
Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male High
Male
Male
Male
High
Male High
Male
High
Male
High
Male
High
Male
High
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Other
Other
High
High
High
High
High
High
High
High
High
Other
******
Other
High
Other
Other
Other
High
Other
Other
Other
Other
Other
Other
Other
High
Male
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
Moderate
High
High
High
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Male
Other
Other
Other
Other
High
Other
High
Other High
Other High
Other
High
High
High
High
High
High
Low
Low
Low
Low
Low
Low
Low
Low
Other High
Male
Male
Male
Male
Male
Male
Low
Low
Low
Low
Low
Other High
Low
Low
Low
Other High
Other High
បទនិ
High
Low
Low
Low
Low
Low
Low
Low
Low
Low
Moderate
Moderate
Moderate
Moderate
Moderate
Other
Other Moderate
Moderate
Other
Female High
Female Hight
Female High
Female High
Female High
Female High
Female
High
High
Female
Female
Female High
High
Female High
Female
High
Female High
Female
High
Female High
Female High
Female High
Female
Hight
Female High
Female
High
Female High
Female High
Female High
Female High
Female High
Female High
Female High
Female High
Female
Female
Female
Female
Female
Low
Female Low
Female
Low
Female
Low
Female
Low
High
High
Low
Low
Female
Low
Female
Moderate
Female Moderate
Moderate
Female
Female
Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Moderate
Female
Female
Moderate
Female
Moderate
Female Moderate
Female Moderate
Female Moderate
Female Moderate
Female
Female
Female
Moderate
Moderate
Moderate
Female
Moderate
Female
Moderate
Female Moderate
Moderate
Female
Female
Moderate
Female Moderate
Female Moderate
Female Moderate
Hight
High
High
High
High
High
36
36
33
34
37
38
39
37
20
29
36
37
37
24
36
37
30
36
35
38
38
36
36
37
32
37
28
28
36
37
33
27
32
39
39
34
37
34
36
33
37
34
35
36
37
29
38
38
38
36
36
38
35
37
38
33
23
29
38
36
36
36
33
35
39
27
29
36
32
34
37
37
37
38
38
37
39
39
39
34
36
38
33
34
30
39
37
29
33
31
38
34
38
37
32
37
36
31
35
38
38
36
38
34
35
34
30
37
29
35
33
38
38
35
34
37
34
32
39
22
38
37
39
35
29
38
38
36
37
36
36
29
37
37
37
33
36
32
36
39
38
31
25
37
34
38
21
39
30
22
49
46
46
45
50
41
44
47
48
46
47
50
46
46
47
47
50
51
47
49
48
34
48
49
51
45
45
46
50
46
42
51
47
47
47
46
48
41
49
49
37
47
48
46
49
43
48
48
45
46
48
49
42
47
48
48
49
49
48
50
45
48
45
49
48
48
48
65
47
44
Vitamin_D_Level
20
15
14
14
16
18
18
19
20
20
20
20
21
22
22
23
27
12
19
16
16
17
18
18
19
19
21
21
21
21
22
24
TELEFON ⁰000
24
32
19
6
11
14
15
16
16
17
18
18
18
20
IEEEEEEEE
21
21
21
22
23
23
24
24
30
40
11
15
17
22
14
15
16
16
16
17
17
18
28 2999HHAGANN
20
20
20
20
20
20
20
21
21
23
24
27
22
13
15
15
16
16
18
19
19
20
22
23
23
MARTENEN9288722#G#99999
25
39
12
15
12
14
13
14
15
16
16
17
19
19
20
20
21
21
21
24
24
25
30
34
40
13
13
14
16
16
16
18
18
19
21
22
23
31
14
16
20
21
23
23
24
25
28
17
17
17
18
21
24
37
21
22
23
25
25
26
27
27
27
28
28
28
29
29
29
29
29
29
30
30
31
32
32
32
32
33
34
34
35
37
25
27
28
29
32
33
33
35
19
24
26
26
26
27
27
28
28
28
29
29
29
30
34
31
28
22
34
31
32
32
33
33
34
34
13
14
19
19
20
22
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Transcribed Image Text:c) Read the above code carefully and explain what each line is doing
d) To investigate the difference in vitamin D level between countries, write down the
general assumptions of the appropriate statistical test, and check them using graphs
and/or outputs from your statistical package of choice. Note: use the
"Question_1_Country" dataset for this question.
For normality, minimum two graphs
For testing the homogeneity of variances, use Levene's test.
Note: If using R, for Levene's test, install the R package "car".
Does the response variable need any transformation? Why?
e) Compare vitamin D levels for country A and country B at a significance level of 5% using a
t-test, one-way ANOVA, and regression. Compare the results of all three techniques.
For one-way ANOVA use t-test (LSD.test). Plot t-test and regression.
Note: use the "Question_1_Country" dataset for this question.
If you are using R, for the LSD.test function, install the package "agricolae".
Solution
Recommended textbooks for you

MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc

Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning

Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning

MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc

Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning

Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning

Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON

The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman

Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman