Starting from:

$25

stats500 - HOMEWORK 1 - Solved

The dataset teengamb concerns a study of teenage gambling in Britain. Please use the dataset to answer the following questions:

After you install R (if it is not already installed on the system you are using) and the faraway package, you can type library(faraway) to load the package and data(teengamb) to load the data. This dataset is from a survey conducted to study teenage gambling in Britain. It contains five variables: sex, status, income, verbal, gamble. More details about the dataset can be found in

Ide-Smith & Lea (1988) Journal of Gambling Behavior, 4, 110-118.

1.    For the variable “sex”, assign the label “male” and “female” and ask R to treat it as a categorical variable when you provide a summary of the data. Then provide graphical and numerical summaries of the data to be included in your homework.

Solution to this question should be no longer than 1.5 pages.

2.    In your summary, report the means and medians of variables “income” and “gamble”. Please comment on the relative locations of the mean and median for each variable. Would you be able to “guess” this relationship based on their boxplots?

3.    How many different values are there for the variable “verbal”? (hint: help(unique))

4.    Based on the boxplot (and any other ways you can define and explain) of the variable “verbal”, what could be the possible values of outlying verbal scores?

5.    Suppose you are interested in how variables, such as “verbal”, “income” and “gamble” differ for different ”sex”. Use numerical and/or graphical tool(s) to summarize the data for this purpose, commenting on any features that you find interesting. Limit the output you present to a quantity that a busy reader would find sufficient to get a basic understanding of your answer.

Hints: Useful R functions for this homework can be found in the course documents that are available on ctools. You can always type help(subject) to get detailed help on the subject, e.g. help(plot). Or you can type help.start() to get interactive help with a search engine.

More products