100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
Previously searched by you
MATH CMTH 110 Discrete Math - Ryerson University. ASSIGNMENT in R_ Part 1 – Analysis of categorical data, Part 2 - ANOVA and Part 3 – SIMPLE and MULTIPLE REGRESSION with R. Spring-April 2023. Questions and Solutions$15.99
Add to cart
MATH CMTH 110 Discrete Math - Ryerson University. ASSIGNMENT in R_ Part 1 – Analysis of categorical data, Part 2 - ANOVA and Part 3 – SIMPLE and MULTIPLE REGRESSION with R. Spring-April 2023. Questions and Solutions
14 views 0 purchase
Course
MATH CMTH 110 Discrete Math - Ryerson University.
Institution
MATH CMTH 110 Discrete Math - Ryerson University.
MATH CMTH 110 Discrete Math - Ryerson University. ASSIGNMENT in R_ Part 1 – Analysis of categorical data, Part 2 - ANOVA and Part 3 – SIMPLE and MULTIPLE REGRESSION with R. Spring-April 2023. Questions and Solutions
math cmth 110 discrete math ryerson university assignment in r part 1 – analysis of categorical data
part 2 anova and part 3 – simple and multiple regression with r spring april 2023 question
Written for
MATH CMTH 110 Discrete Math - Ryerson University.
All documents for this subject (1)
Seller
Follow
AllAcademic
Reviews received
Content preview
ASSIGNMENT in R (part 1 – Analysis of categorical data)
For all problems, show the code, required to answer each of the questions, in blue,
and corresponding R output in black. Use copy & paste function in R environment
to copy and paste the code and the output. Problem 1. ( 5 marks)
Nearly 75% of all death in the United States are attributed to just 10 causes, with the top four of
these accounting for over 50% of all non -accidental deaths as follows: heart disease (23.4%),
cancer (22.5%), respiratory disease (5.6%), and stroke (5.1%). The study of the causes of n =308
non – accidental deaths at a local hospital gave the following counts.
Cause Heart Cancer Respiratory Stroke Other
Disease Disease
Deaths 78 81 28 16 105 308
Do the data provide sufficient information to indicate that the number of deaths at this hospital
differ significantly from the proportion in the population in large?
Test appropriate hypothesis at 5% level of significance using R. For
full solution
1. State the null and alternative hypotheses.
2. Represent frequency table with categories
Heart Disease Cancer Respiratory Disease Stroke Other
3. Perform chi - square test and represent its results.
Show the code, required to answer questions 2 and 3, in blue, and
corresponding R output in black. Use copy & paste function in R environment
to copy and paste the code and the output.
4. Make the conclusions about truth or falsity of stated hypotheses.
1
, We test the number of deaths at this hospital differ significantly from the
proportion in the population in large.
Since the p- value = 0.00408 < 0.05 we reject null hypothesis at α=0.05.
There is sufficient sample evidence that proportions p1 = 23.4%, p2 = 22.5%, p3
= 5.6%, p4 = 5.1% , p5 = 43.4% given in null hypothesis are incorrect.
2
,Problem 2 (5 marks)
Accident data were analyzed to determine the number of fatal accidents for the cars of three
sizes. The data for 346 accidents are as follows.
Small Medium Large
Fatal 67 26 16
Not Fatal 128 63 46
Do the data indicate that the frequency of fatal accidents is dependent on the size of the cars?
Test appropriate hypothesis using R. Assume 0.05 level of significance.
For full solution
1. State the null and alternative hypotheses.
2. Represent contingency table with two categorical variables Type of Accident
(levels Fatal and Not Fatal) and
Car Size (levels are Small, Medium, and Large)
3. Perform chi - square test and represent its results.
Show the code, required to answer questions 2 and 3, in blue, and
corresponding R output in black. Use copy & paste function in R environment
to copy and paste the code and the output.
4. Make the conclusions about truth or falsity of stated hypotheses.
3
, H0 : the frequency of fatal accidents is independent on the size of the car
H1 : the frequency of fatal accidents is depends on the size of the cars
> B<-matrix(c(67,128,26,63,16,46), nrow = 2,
+ dimnames = list(Type_of_Accident = c("Fatal", "Not Fatal"),
+ Car_Size = c("Small", "Median", "Large")))
> B
Car_Size
Type_of_Accident Small Median Large
Fatal 67 26 16
Not Fatal 128 63 46
Since p- value = 0.3895 > 0.05 null hypothesis is not rejected. There is insufficient
sample evidence to conclude that the frequency of fatal accidents is independent on
the size of the car.
4
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller AllAcademic. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $15.99. You're not tied to anything after your purchase.