Using the .csv version of the data you read in,

1. Examine the structure of the first 10 variables using the str() function.
2. What is the class of the variable games?
3. What does the summary of the variable games tell you?


1.


str(mcs1,list.len=10)
'data.frame': 11872 obs. of 52 variables:
$ mcsid : Factor w/ 11714 levels "M10002P","M10007U",..: 1 2 3 4 5 6 7 8 9 10 ...
$ cnum : int 1 1 1 1 1 1 1 1 1 1 ...
$ sex : Factor w/ 2 levels "boy","girl": 1 1 2 1 2 2 2 1 1 1 ...
$ tv : Factor w/ 9 levels "","1 hour t",..: 3 4 8 3 4 4 3 2 1 7 ...
$ games : Factor w/ 9 levels "","1 hour t",..: 8 6 8 2 9 2 8 3 1 4 ...
$ compu : Factor w/ 3 levels "","no","yes": 3 2 3 3 2 3 2 3 1 3 ...
$ internet : Factor w/ 9 levels "","1 hour t",..: 2 6 8 2 5 3 2 7 1 3 ...
$ social : Factor w/ 9 levels "","1 hour t",..: 7 5 8 8 2 3 2 6 1 7 ...
$ engl : Factor w/ 4 levels "","Agree","Disagree",..: 2 4 2 2 2 2 2 2 1 3 ...
$ mths : Factor w/ 4 levels "","Agree","Disagree",..: 4 3 3 2 2 2 2 3 1 2 ...
[list output truncated]

2.

class(mcs1$games)
[1] "factor"
The class is “factor”

3.

summary(mcs1$games)
1 hour t 2 hours 3 hours 5 hours 7 hours Half an Less tha
360 1751 1583 1478 770 862 1343 1565
None
2160

The summary provides the number of observations at each category of the variable games.

Social Work & Human Services

You might also like to view...

Describe the pros and cons of centralized versus decentralized organizations.

What will be an ideal response?

Social Work & Human Services

_____ involves a financial agreement or contract where one agency agrees to purchase services from another agency.

A. Managed care agreement B. Purchase-of-service C. Mutual aid contract D. Reciprocity agreement

Social Work & Human Services

Most battered women really enjoy the beating they receive or else they would leave

a. True b. False

Social Work & Human Services

Public testimony, consulting in drafting legislation, monitoring government bodies and engaging in

relationship building activities are all: a) Prohibited activities for registered lobbyists. b) Some services / activities lobbyists provide. c) Considered unethical activities for Senate or House members and staff. d) Carefully monitored by NASW.

Social Work & Human Services