Introduction to Statistics (MAT/SST 115.03 2008S)
Primary: [Front Door] [Syllabus] [Current Outline] [R] - [Academic Honesty] [Instructions]
Groupings: [Applets] [Assignments] [Data] [Examples] [Handouts] [Labs] [Outlines] [Projects] [Readings] [Solutions]
External Links: [R Front Door] [SamR's Front Door]
You can load the data with
StateData = read.csv("/home/rebelsky/Stats115/Data/Governors05.csv")
Since that data set turns out to have many more columns than are reported in the table on p. 554, it's useful to see a quick summary of the data.
>summary(StateData)State Eastwest Region Median.Housing.Value Median.Household.IncomeAlabama : 1 east:26 Midwest :12 Min. : 70700 Min. :32397Alaska : 1 west:24 Northeast: 9 1st Qu.: 88475 1st Qu.:38414Arizona : 1 South :16 Median :108200 Median :42621Arkansas : 1 West :13 Mean :117990 Mean :43172California: 1 3rd Qu.:139825 3rd Qu.:47980Colorado : 1 Max. :272700 Max. :56409(Other) :44Governor.SalaryMin. : 700001st Qu.: 95340Median :111352Mean :1179843rd Qu.:132161Max. :179000
You can plot those data with
plot(StateData$Median.Housing.Value, StateData$Governor.Salary)
We are fortunate that these data do not include any NA
values. Hence, we can compute the correlation coeficient directly.
cor(StateData$Median.Housing.Value, StateData$Governor.Salary)
It's been a long time since we've updated a frame. We can use
fix to bring up the data editor on that
frame.
fix(StateData)
After changing the appropriate cell, click somewhere else in the grid before closing the edit window. Your changes are not saved until you close the window. (You also cannot continue working in R until you close the window.)
At least in the Unix version of R, it seems that you change a cell by deleting the old contents and then enter the new contents. The new salary should be 194780.
You may want to check to make sure that the salary was, indeed, updated.
StateData[11,]
Primary: [Front Door] [Syllabus] [Current Outline] [R] - [Academic Honesty] [Instructions]
Groupings: [Applets] [Assignments] [Data] [Examples] [Handouts] [Labs] [Outlines] [Projects] [Readings] [Solutions]
External Links: [R Front Door] [SamR's Front Door]
Copyright (c) 2007-8 Samuel A. Rebelsky.
This work is licensed under a Creative Commons
Attribution-NonCommercial 2.5 License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-nc/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.