Chi-squared test with R programming

profilespringbird
Cancerandoverweightcodeanalysis.docx

This question compares the proportions of overweight and cancer from the data file shown in the following link:

https://drive.google.com/file/d/1T_37kwyyAFZhM5hh9OVtYeDL3Zrmu3hC/view

The file name is:   cancer data for MOOC 1.csv

We are required to

a. load the csv file on your desk top.

b. extract only two columns of data from the csv file: the BMI and Cancer columns

c. compare the proportions of overweight and cancer

BMI >= 25 is defined as overweight and is assigned (1) and not overweight is assigned (0).

The null hypothesis was that overweight and cancer are not associated.

We are required to perform chi_square test in order to implement this comparison.

A p-value of 0.6497 was obtained from running these lines of code indicating that the null hypothesis should be accepted. However, I get 0% when I submitted my answer to the question. Apparently a couple of my classmates got full mark when their conclusion was to reject the hypothesis based on their p-value.

Please take a look at the original csv data file and review the logical flow of the attached R codes and let me know if there are problems with the overweight and cancer data selected for the chi_square test and errors in the codes.

I enclose herewith a copy of the screenshot of the codes and the p-value output for your reference.

I also include a copy of the grade sheet showing a mark of 0% and comments.