Using an abbreviated version of the 2015 UK Millennium Cohort survey dataset (mcs.dta), perform the following exercises. Note: the survey was carried out in 2015 to 14 year-old pupil in the UK. The dataset consists of nearly 12,000 observations and 52 variables. You need to use the haven package to read-in the data. Perform recoding and labeling on the variables below. Note: for all the variables, you need to first convert them to factors using the as.factor() function.

mths - rename as maths and label the values as 1=’1. Strongly Disagree’;2=’2. Disagree’;3=’3. Agree’;4=’4. Strongly Agree’. This variable includes pupils’ responses to whether they were good at mathematics.


Read-in 2015 Millennium Cohort Study data.


setwd("c:/QSSD/Exercises/Chapter 5 - Exercises")
getwd()
[1] "c:/QSSD/Exercises/Chapter 5 - Exercises"
library(haven)
mcs <- read_dta("mcs.dta")



library(car)
Warning: package 'car' was built under R version 3.4.3
mcs$mths <- as.factor(mcs$mths)
table(mcs$mths)
1 2 3 4
598 1827 5958 3118
mcs$maths <- recode(mcs$mths, "1='1. Strongly Disagree';2='2. Disagree';
3='3. Agree';4='4. Strongly Agree'")
table(mcs$maths)
1. Strongly Disagree 2. Disagree 3. Agree
598 1827 5958
4. Strongly Agree
3118

Social Work & Human Services

You might also like to view...

Non-parametric tests are one of the only ways to analyze which of the following questions?

a. The different distributions of democratic, republican, and independent students in different majors on a college campus. b. How temperature influences anxiety levels before an exam. c. The length of infant eye gaze when seeing something novel versus familiar. d. How being from low-, mid-, and high-class families predict the number of Christmas gifts children receive.

Social Work & Human Services

Involves efforts to correct historical imbalances in opportunities based on race and sex.

Social Work & Human Services

Because the world is filled with uncertainties and the future cannot accurately be predicted, some organizations envision ________________to identify a range of plausible situations.

A) scenarios B) ideas C) considerations D) possibilities

Social Work & Human Services

When observing in the field observation, Sally helped the daycare teachers clean up at the end of the day. She also answered the telephone when everyone else was busy. This illustrates

A) the use of gatekeepers. B) the use of small favors. C) appearance of interest. D) managing conflict in the field.

Social Work & Human Services