---
title: "Week 2 Homework"
output: word_document
---

1. The data in the Sahlins data frame (car package) were compiled by Sahlins (1972) from information presented in Scudder’s (1962) report on the Gwenba valley of Central Africa. The data describe agricultural production in Mazulu village. The explanatory variable (Con- sumers/Gardener) is the ratio of consumers to productive individuals in each of 20 households, making suitable adjustments for the consumption requirements of different household members. The response variable (Acres/Gardener) is a measure of domestic-labor intensity, based on the amount of land cultivated by each household. Think of Consumers/Gardener as representing the relative consumption needs of the household, and Acres/Gardener as representing how hard each productive individual in the household works. Sahlins was interested in production, consumption, and redistribution of the social product in “primitive” communities.
    a. Draw a scatterplot of Acres/Gardener (Y ) versus Consumers/Gardener (X). What rela- tionship, if any, do you discern in this plot–does the relationship appear to be positive or negative (or neither), linear or nonlinear, strong or weak? Is there anything else note- worthy about the data–for example, do any households appear to be unusual?
```{r}

```
    b. Notice that the households are ordered by the values of Consumers/Gardener (X). Divide the 20 households into three groups, placing the first seven households in the first group, the next six in the second group, and the last seven in the third group. Calculate the mean Y and mean X in each of the three groups. Transfer these means to the scatterplot and connect them with a simple nonparametric regression line. Does the regression line help you to interpret the relationship between the variables?
```{r}

```
    c. Two of the households, one in the first group, one in the second (which ones?), stand out from the others. Recalculate the means in groups 1 and 2 omitting the outlying observations, and redraw the nonparametric regression line. How, if at all, do the new means differ from the original values?
```{r}

```
    d. Use a computer program to fit a nonparametric regression line to Sahlins’s data using locally weighted regression (lowess). How would you summarize the relationship between Acres/Gardener and Consumers/Gardener?
```{r}

```

2. The data in the Robey data frame (car package) are drawn from a report by Robey, Shea, Rutstein, and Morris (1992) on the fertility decline in developing countries. The data show the total fertility rate (Y ) and the percentage of married women aged 15 to 44 who use contraceptives (X) in each of 50 developing countries (along with the region of the world in which each country is located). The total fertility rate is the expected number of births to a woman who survives through her child-bearing years under current age-specific fertility rates. Repeat Exercise D2.1 for this dataset, using three groups of 17, 16, and 17 observations.
    a. Draw a scatterplot of total vertility rate, named tfr, (Y) versus contraceptors (X). What relationship, if any, do you discern in this plot–does the relationship appear to be positive or negative (or neither), linear or nonlinear, strong or weak? Is there anything else noteworthy about the data–for example, do any households appear to be unusual?
```{r}

```
    b. Divide the 50 countries into three groups (of 17, 16 and 17 based on contraceptors). Calculate the mean Y and mean X in each of the three groups. Transfer these means to the scatterplot and connect them with a simple (i.e., naive) nonparametric regression line. Does the regression line help you to interpret the relationship between the variables?
```{r}

```
    c. Do any of the observations stand out from the others. Omit the outlying observations, recalculate the means in the relevant groups and redraw the nonparametric regression line. How, if at all, do the new means differ from the original values?
```{r}

```
    d. Use a computer program to fit a nonparametric regression line to Sahlins’s data using locally weighted regression (lowess). How would you summarize the relationship between Acres/Gardener and Consumers/Gardener?
```{r}

```


3. Using the methods described in Section 3.1, examine the distributions of the quantitative variables in one of the following data sets: Angell, Anscombe, Chirot, Duncan, Ericksen, Freedman, Leinhardt, States, and UnitedNations (all in the car package). Characterize the distribution of each variable in terms of symmetry or skewness; non-normality or apparent normality; number of modes; and the presence or absence of unusual values.
```{r}

```

4. Recall from Chapter 2 Davisís data on measured and reported weight for women engaged in regular exercise, plotted (for example) in Figure 2.11. Both measured and reported weight were recorded to the nearest kilogram. Correct the outlying observation, and investigate whether jittering measured and reported weight calories the relationship between the two variables. It might help to show the line on the scatterplot.
```{r}

```
5. Each of the data sets - Angell, Anscombe, Chirot, Duncan, Ericksen, Freedman, Leinhardt, States, and UnitedNations (all in the car package) - contains at least one quantitative response variable. Select one of these data sets, or another suitable data set of interest to you. Using the methods described in Section 3.2, examine and characterize the relationship between the response variable and each quantitative or categorical explanatory variable:
```{r}

```
6. The Burt data frame (in the car package), provides data on the IQs of 27 pairs of identical twins reared apart, were reported by Sir Cyril Burt (1966). (These data were  notoriously manufactured.) One twin in each pair was presumably raised by his or her biological parents; the other twin was raised in a foster home. In each case, Burt recorded (i.e., made up) the social class which the twins' biological parents belonged. Use a scatterplot coded by social class to examine the relationship between the two twins' IQs, treating the IQ of the twin raised by biological parents as the response variable. Can you tell from the plot that the data are fraudulent? (Hint: Compute the linear least-squares regression separately for each class and place the regression lines on the scatterplot.)
```{r}

```
7. Using the data from Exercise 5, construct a scatterplot matrix for the response variable and the quantitative explanatory variables. If there are more than two explanatory variable, pick two, and, along with the response variable, construct a dynamic 3D scatterplot. Characterize the pairwise relationships among the variables and the relationship of the response to the explanatory variables.
```{r}

```

