In R, please provide the code needed to do the following You will need the e1071 package to compute skewness of data 1) Set up the e1071 package a. Install the package using the install.packages() function b. Load the package in R using the library() function 2) Set up the BSDA package a. Install the package using the install.packages() function b. Load the package in R using the library() function 3) Read the R documentation on the t.test() and z.test() functions a. Reminder: you can access the documentation for functions in R by typing ?? function_name so ?? t.test will bring up the search results in the Help Tab (in the same part of the screen where files and plots and packages are), then you can select the option for Student’s t-Test because that is the relevant result. ??z.test will bring up the search result so ?? z.test will bring up the search results in the Help Tab (in the same part of the screen where files and plots and packages are), then you can select the option for BSDA::z.test because that is the relevant result. You can also find the documentation from the link below. https://www.rdocumentation.org/packages/BSDA/versions/1.2.1/topics/z.test z. b. How many parameters does z.test function require (read the documentation for this function and exclude the optional arguments (if there is any)? 4) 2-sided hypothesis test when the true variance is known a. Load the Nile data set b. Using the Nile data set, conduct a hypothesis test to determine if the true mean is equal to 920. It is given that the true variance is 28350. You should use α = 0.05. You should use the z.test() function to complete your work for this question. c. Would you reject or fail to reject the null hypothesis? Is this consistent with your conclusion from Lab 5? 5) Initial data overview of the birthwt data set a. Load the birthwt data set in R. You will need to tell R that you want to use the MASS library first. b. What are the column headers for this data set? c. How many total rows of data are in the data set? d. Create new data frames to store the data that corresponds to babies born to mothers who did and did not smoke. e. Determine the number of samples, the sample mean, sample variance, and skewness of the birth weights for each group (smokers and non-smokers) f. Based on the initial summary values, do you expect that the mean birth weight of the two groups is the same or different? 6) 2 sample hypothesis test when the true variance is unknown. Use α=0.95 for all of the tests with this data set. a. Generate qq plots, with reference lines, for the birth weights of all babies, babies born to mothers who smoke and babies born to mothers who do not smoke to confirm that it is reasonable to proceed with the assumption that birthweights are normally distributed. b. Use the t.test function and the two new data frames you have created to conduct a test to determine if the mean birth weight of the two groups is the same or not. i. What are the null and alternate hypotheses for this test? ii. What is your conclusion? Give a brief explanation to justify your answer. c. Use the t.test function and the two new data frames you have created to conduct a test to determine if the mean birth weight of babies born to smoking mothers is less than the mean birth weight of babies born to non-smoking mothers. i. What are the null and alternate hypotheses for this test? ii. What is your conclusion? Give a brief explanation to justify your answer. d. Use the t.test function and the original data directly (not your two new data frames) to conduct a test to determine if the mean birth weight of the two groups is the same or not. Confirm that your results are the same as the results in part b. e. Use the t.test function and the original data directly (not your two new data frames) to conduct a test to determine if the mean birth weight of the babies born to smoking mothers is smaller than the mean birth weight of babies born to non-smoking mothers. Confirm that your results are the same as the results in part c.
In R, please provide the code needed to do the following You will need the e1071 package to compute skewness of data 1) Set up the e1071 package a. Install the package using the install.packages() function b. Load the package in R using the library() function 2) Set up the BSDA package a. Install the package using the install.packages() function b. Load the package in R using the library() function 3) Read the R documentation on the t.test() and z.test() functions a. Reminder: you can access the documentation for functions in R by typing ?? function_name so ?? t.test will bring up the search results in the Help Tab (in the same part of the screen where files and plots and packages are), then you can select the option for Student’s t-Test because that is the relevant result. ??z.test will bring up the search result so ?? z.test will bring up the search results in the Help Tab (in the same part of the screen where files and plots and packages are), then you can select the option for BSDA::z.test because that is the relevant result. You can also find the documentation from the link below. https://www.rdocumentation.org/packages/BSDA/versions/1.2.1/topics/z.test z. b. How many parameters does z.test function require (read the documentation for this function and exclude the optional arguments (if there is any)? 4) 2-sided hypothesis test when the true variance is known a. Load the Nile data set b. Using the Nile data set, conduct a hypothesis test to determine if the true mean is equal to 920. It is given that the true variance is 28350. You should use α = 0.05. You should use the z.test() function to complete your work for this question. c. Would you reject or fail to reject the null hypothesis? Is this consistent with your conclusion from Lab 5? 5) Initial data overview of the birthwt data set a. Load the birthwt data set in R. You will need to tell R that you want to use the MASS library first. b. What are the column headers for this data set? c. How many total rows of data are in the data set? d. Create new data frames to store the data that corresponds to babies born to mothers who did and did not smoke. e. Determine the number of samples, the sample mean, sample variance, and skewness of the birth weights for each group (smokers and non-smokers) f. Based on the initial summary values, do you expect that the mean birth weight of the two groups is the same or different? 6) 2 sample hypothesis test when the true variance is unknown. Use α=0.95 for all of the tests with this data set. a. Generate qq plots, with reference lines, for the birth weights of all babies, babies born to mothers who smoke and babies born to mothers who do not smoke to confirm that it is reasonable to proceed with the assumption that birthweights are normally distributed. b. Use the t.test function and the two new data frames you have created to conduct a test to determine if the mean birth weight of the two groups is the same or not. i. What are the null and alternate hypotheses for this test? ii. What is your conclusion? Give a brief explanation to justify your answer. c. Use the t.test function and the two new data frames you have created to conduct a test to determine if the mean birth weight of babies born to smoking mothers is less than the mean birth weight of babies born to non-smoking mothers. i. What are the null and alternate hypotheses for this test? ii. What is your conclusion? Give a brief explanation to justify your answer. d. Use the t.test function and the original data directly (not your two new data frames) to conduct a test to determine if the mean birth weight of the two groups is the same or not. Confirm that your results are the same as the results in part b. e. Use the t.test function and the original data directly (not your two new data frames) to conduct a test to determine if the mean birth weight of the babies born to smoking mothers is smaller than the mean birth weight of babies born to non-smoking mothers. Confirm that your results are the same as the results in part c.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
In R, please provide the code needed to do the following
You will need the e1071 package to compute skewness of data
1) Set up the e1071 package
a. Install the package using the install.packages() function
b. Load the package in R using the library() function
2) Set up the BSDA package
a. Install the package using the install.packages() function
b. Load the package in R using the library() function
3) Read the R documentation on the t.test() and z.test() functions
a. Reminder: you can access the documentation for functions in R by typing
?? function_name
so ?? t.test will bring up the search results in the Help Tab (in the same part of the
screen where files and plots and packages are), then you can select the option for
Student’s t-Test because that is the relevant result.
??z.test will bring up the search result
so ?? z.test will bring up the search results in the Help Tab (in the same part of the
screen where files and plots and packages are), then you can select the option for
BSDA::z.test because that is the relevant result.
You can also find the documentation from the link below.
a. Install the package using the install.packages() function
b. Load the package in R using the library() function
2) Set up the BSDA package
a. Install the package using the install.packages() function
b. Load the package in R using the library() function
3) Read the R documentation on the t.test() and z.test() functions
a. Reminder: you can access the documentation for functions in R by typing
?? function_name
so ?? t.test will bring up the search results in the Help Tab (in the same part of the
screen where files and plots and packages are), then you can select the option for
Student’s t-Test because that is the relevant result.
??z.test will bring up the search result
so ?? z.test will bring up the search results in the Help Tab (in the same part of the
screen where files and plots and packages are), then you can select the option for
BSDA::z.test because that is the relevant result.
You can also find the documentation from the link below.
https://www.rdocumentation.org/packages/BSDA/versions/1.2.1/topics/z.test
z.
b. How many parameters does z.test function require (read the documentation for this
function and exclude the optional arguments (if there is any)?
4) 2-sided hypothesis test when the true variance is known
a. Load the Nile data set
b. Using the Nile data set, conduct a hypothesis test to determine if the true mean is equal
to 920. It is given that the true variance is 28350. You should use α = 0.05.
You should use the z.test() function to complete your work for this question.
c. Would you reject or fail to reject the null hypothesis? Is this consistent with your
conclusion from Lab 5?
5) Initial data overview of the birthwt data set
a. Load the birthwt data set in R. You will need to tell R that you want to use the MASS
library first.
b. What are the column headers for this data set?
c. How many total rows of data are in the data set?
d. Create new data frames to store the data that corresponds to babies born to mothers
who did and did not smoke.
e. Determine the number of samples, the sample mean, sample variance, and skewness of
the birth weights for each group (smokers and non-smokers)
f. Based on the initial summary values, do you expect that the mean birth weight of the
two groups is the same or different?
6) 2 sample hypothesis test when the true variance is unknown. Use α=0.95 for all of the tests
with this data set.
a. Generate qq plots, with reference lines, for the birth weights of all babies, babies born
to mothers who smoke and babies born to mothers who do not smoke to confirm that it
is reasonable to proceed with the assumption that birthweights are normally
distributed.
b. Use the t.test function and the two new data frames you have created to conduct a test
to determine if the mean birth weight of the two groups is the same or not.
i. What are the null and alternate hypotheses for this test?
ii. What is your conclusion? Give a brief explanation to justify your answer.
c. Use the t.test function and the two new data frames you have created to conduct a test
to determine if the mean birth weight of babies born to smoking mothers is less than
the mean birth weight of babies born to non-smoking mothers.
i. What are the null and alternate hypotheses for this test?
ii. What is your conclusion? Give a brief explanation to justify your answer.
d. Use the t.test function and the original data directly (not your two new data frames) to
conduct a test to determine if the mean birth weight of the two groups is the same or
not. Confirm that your results are the same as the results in part b.
e. Use the t.test function and the original data directly (not your two new data frames) to
conduct a test to determine if the mean birth weight of the babies born to smoking
z.
b. How many parameters does z.test function require (read the documentation for this
function and exclude the optional arguments (if there is any)?
4) 2-sided hypothesis test when the true variance is known
a. Load the Nile data set
b. Using the Nile data set, conduct a hypothesis test to determine if the true mean is equal
to 920. It is given that the true variance is 28350. You should use α = 0.05.
You should use the z.test() function to complete your work for this question.
c. Would you reject or fail to reject the null hypothesis? Is this consistent with your
conclusion from Lab 5?
5) Initial data overview of the birthwt data set
a. Load the birthwt data set in R. You will need to tell R that you want to use the MASS
library first.
b. What are the column headers for this data set?
c. How many total rows of data are in the data set?
d. Create new data frames to store the data that corresponds to babies born to mothers
who did and did not smoke.
e. Determine the number of samples, the sample mean, sample variance, and skewness of
the birth weights for each group (smokers and non-smokers)
f. Based on the initial summary values, do you expect that the mean birth weight of the
two groups is the same or different?
6) 2 sample hypothesis test when the true variance is unknown. Use α=0.95 for all of the tests
with this data set.
a. Generate qq plots, with reference lines, for the birth weights of all babies, babies born
to mothers who smoke and babies born to mothers who do not smoke to confirm that it
is reasonable to proceed with the assumption that birthweights are normally
distributed.
b. Use the t.test function and the two new data frames you have created to conduct a test
to determine if the mean birth weight of the two groups is the same or not.
i. What are the null and alternate hypotheses for this test?
ii. What is your conclusion? Give a brief explanation to justify your answer.
c. Use the t.test function and the two new data frames you have created to conduct a test
to determine if the mean birth weight of babies born to smoking mothers is less than
the mean birth weight of babies born to non-smoking mothers.
i. What are the null and alternate hypotheses for this test?
ii. What is your conclusion? Give a brief explanation to justify your answer.
d. Use the t.test function and the original data directly (not your two new data frames) to
conduct a test to determine if the mean birth weight of the two groups is the same or
not. Confirm that your results are the same as the results in part b.
e. Use the t.test function and the original data directly (not your two new data frames) to
conduct a test to determine if the mean birth weight of the babies born to smoking
mothers is smaller than the mean birth weight of babies born to non-smoking mothers.
Confirm that your results are the same as the results in part c.
Confirm that your results are the same as the results in part c.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education