Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

B . Section B - R Write all your commands in one script file that you should save as Script.R Capture the collected data

B. Section B-R
Write all your commands in one script file that you should save as "Script.R"
Capture the collected data in the form of a data frame with a name of your choice
For the data frame that you created above,
(a) Write an R command to extract the element in the 8th row 4th column.
(b) Write an R command to extract the 15th row.
(c) Write an R command to extract the 11th column.
(d) Write an R command to extract the elements in rows 2,1,19 columns 2 to 7
(e) Write an R command to extract all people who like the BMW.
(f) Write an R command to extract data on all the female respondents who like the BMW.
(g) Write an R command to extract the data for all respondents who do not have Postgraduate degrees.
(h) Write an R command to extract the data for all respondents who BMW or Mercedes Benz..
(i) Add a new variable called heightcat and created by dividing the heights into 3 equal categories named "short","Medium" and "tall".
(j) Write an R command to extract respondents whose height is below 130 cm .
(k) Sort your data frame in descending order of height.
(l) Export your data frame to the file "final.csv"
(m) Create a histogram of the heights of these individuals. Comment on the histogram.
(n) Create a well labeled bar graph to depict the distribution of the car prefences of the respondents. Label the axis, and give a title to the bar graph. Comment on the bar graph.
(o) Perform a chi-squared test to determine if the heightcat is independent of gender? Comment on the results of the chi-square test
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

Students also viewed these Databases questions