logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
StatAnalytica ExpertHistory
(5/5)

630 Answers

Hire Me
expert
Nafees AliFinance
(5/5)

805 Answers

Hire Me
expert
Cheryl ZhaoEducation
(4/5)

593 Answers

Hire Me
expert
Jax MahoneySocial sciences
(5/5)

753 Answers

Hire Me
R Programming
(5/5)

did the proportion of students practising sport regularly increased or decreased with respect to the 1995 data

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

The data file s50_1995.txt contains information on substance use and sporting behaviour for a cohort of 50 pupils aged 13 in 1995 in a school in the West of Scotland.

alcohol Alcohol consumption: 1 (not), 2 (once or twice a year), 3 (once a month), 4 (once a week) and 5 (more than once a week).

drugs Cannabis use: 1 (not), 2 (tried once), 3 (occasional) and 4 (regular).

smoke Smoking status: 1 (not), 2 (occasional) and 3 (regular, i.e. more than once per week).

sport Sport participation: 1 (not regular) and 2 (regular).

1. Load in the data. Convert each column to an ordered factor with appropriate labels [Hint: look at the arguments of the function factor, in particular levels and labels]. Display the structure of the dataset. [2.5]

2. Using base R, create two suitable graphs, with labels, colours etc., one illustrating the variable smoke and the other illustrating the variable sport. Put the two plots next to each other on the same page. Comment on the resulting plots.

3. We would like to be able to summarise such data sets as new data arrive. For this reason, we want to turn the object containing the data into an S3 class called s50survey and write a summary method that will show the proportion of students for every level of each variable. Test your function on the s50_1995.txt data.

4. What is the proportion of pupils who did not use cannabis?

5. Follow up data on the same students has been collected also in 1997. Read in the file s50_1997.txt, convert each column to an ordered factor, and assign the class s50survey to this dataset as well. Test the summary S3 method on this new dataset. 

6. Did the proportion of students practising sport regularly increased or decreased with respect to the 1995 data?

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme