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?
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
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
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme