[RStudio/Graduate] Need held developing a table in RStudio


title: "Spring 2016 PSY737 Final" author: "Keegan Talty" date: "December 14, 2016" output: html_document

'''{r} ''' '''{r} data <- data.frame(state.x77) ```


state.x77: matrix with 50 rows and 8 columns giving the following statistics in the respective columns.


population estimate as of July 1, 1975


per capita income (1974)


illiteracy (1970, percent of population)

Life Exp:

life expectancy in years (1969–71)


murder and non-negligent manslaughter rate per 100,000 population (1976)

HS Grad:

percent high-school graduates (1970)


mean number of days with minimum temperature below freezing (1931–1960) in capital or large city


land area in square miles


U.S. Department of Commerce, Bureau of the Census (1977) Statistical Abstract of the United States.

U.S. Department of Commerce, Bureau of the Census (1977) County and City Data Book.


Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Variable| Variable Description

{r} attach(data) summary(data)

{r fig.height = 12, fig.width=6} dotchart(Life.Exp, row.names(data))) a. Which state had the highest ife expectancy? b. Which state had the lowest life expectancy?

{r} scatterplot matrix; plot(st) a) Which pairs of variables appear to have a linear relationship with Life Expectancy? b) Which do not?

{r} cor(data) a) Which variables correlate most strongly with Life Expectancy? b) Which least strongly?

{r} cor.test(Life.Exp, Frost) What can you conclude about relatioship btwn Life.Exp and Frost? p < .05 standard

{r} Object1<-lm(Life.Exp ~ Murder + HS.Grad + Frost) summary(Object1) anova(Object1) d) What is the multiple R-square for the regression model? e) Which variables contribute to the prediction of Life.Exp ata statistically significant level? (p <.05)

{r} plot(Murder,Life.Exp)

{r} points{Georgia; pch = 16; col=red} text("Georgia") lines(Murder, (72.9736 + (-.2839 * Murder)))

{r} model2<-lm(Life.Exp ~ Murder) model2 e) Would you describe the relationship between Life.Exp and Murder as strong or weak? f) Positive of Negative?

/r/HomeworkHelp Thread