Is there a function in R--analogous to the one in MS Excel--that places
the OLS regression equation (and other key parameters like r^2) on a plot?
Thanks,
Vip
I've loaded the Anscombe data:
> library(car)
> data(Anscombe)
> Anscombe
<I wanted to see that I had the table, and I do. I've omitted here>
> attach(Anscombe)
> objects()
[1] "Anscombe" "last.warning"
I'm not able to call up the variables as you can see above. I'm missing
something ridiculously simple, I know. Any tips would be terrific ;-)
Marie
Hi all-
First of all, I just posted a revised version of the section handout. (I
realized it would be helpful to add some more code commenting in certain
places.)
Secondly, for those of you who didn't come to section this week (Red
Sox-induced delinquency?), I handed out two important things:
-the vector geometry reading for next week
-mid-term evaluation forms for the course
Please take the time to fill out an evaluation (attached). It
really helps us get a sense of how people are doing in the course and
what sorts of things we should be concentrating on in the remainder of the
course. Please drop off the evals in my hanging folder in the Gov Grad
lounge. (There are three of you who missed section, so I won't know whose
is whose.)
Meanwhile, there are copies of the Vector Geometry reading in my box at
CBRSS (room 31, in the reception area.)
Alison
I was graphing in R, and graphics were popping up normally, then I
closed the graphic and, running the same code (having cleared and
restarted the R code from scratch), no more graphics are popping up,
even without doing dev.off(). The graphs are properly created and saved
as pdfs, but do not display.
Anyone know how to get them to come up again? (I apologize, I know this
came up much earlier (week one or two)).
Thanks!
Brodi
Hi all-
I'll make a decision here in Ryan's absence; he may have a different
preference in the future for these sorts of problems. If you'd like to
write out the algebra by hand for problem 2, you can do so.
However, please endeavor to make your
handwriting VERY neat (no arrows, crossed out sections, etc.); otherwise
it's just impossible to read. Also, consider using pencil. This will
make it easier for you to re-write your answer should you get it wrong.
Thanks-
Alison
On Thu, 28 Oct 2004, Michael William Nitsch wrote:
> hi alison,
>
> just wondering about writing up problem 2 - are we expected to put all
> the algebra into emacs, or can that be hand-written.
>
> thanks,
> michael
>
See below:
> I'm having a bit of trouble with confidence intervals and hypothesis
> testing, even though I've done it before! (guess its been a while).
>
> Ok, so say the value I want to test is large, say 60. Is it true that my
> confidence interval will also be a large number, in the range of 60. But
> my test statistic will be a small number (ie if I am testing on the
> t-distribution it will be somewhere between -4 and 4 ish). So when I plot
> the test statistic and confidence intervels on the t-distribution, I am
> still thinking in the range of -4 to 4? Or should this plot be more in
> the range of 60?
>
--> you are right that the numbers marking the edges of your confidence
intervals can be very different than the critical values from the t
distribution corresponding to these cutoffs. For this reason, you only
want to plot the t critical values CORRESPONDING to the 90, 95, and 99%
confidence intervals on the t distribution pdf graph. (remember, you are
taking a quantile like .975 and plugging it into qt() for the relevant
degrees of freedom to obtain the t critical value.)
Let me know if this still isn't clear.
good luck!
Alison
Hi Everyone,
There have been some questions about what we're expecting for the
final paper.
The purpose of the paper is for you to demonstrate that you can use
what we've covered in the course to begin to answer a social
scientific question of interest. The primary emphasis is on sound data
analysis. As such, a comprehensive literature review, a novel
theoretical model, etc. are not required for a good grade. Things you
will be graded on include:
clear statement of the scientific question-- is it clear why you are
fitting a regression model? Is it clear how your estimates relate to
your question of interest?
solid research design-- can your data and methods answer the question
of interest? If there are threats to the validity of your inferences
do you acknowledge them and do you have ideas about how to work around
these problems in future versions of the paper? Are alternative
hypotheses examined?
careful analysis-- do you check to see if the assumptions underlying
inference for OLS regression are violated in your dataset? Simply
stating how you checked which assumptions is all you need to do here.
We will believe you did what you say you did.
reasonable modeling choices-- if some of the assumptions underlying
inference for OLS regression modeling don't hold in your data do you
do reasonable things to eliminate or at least minimize the problems?
correct interpretation of results-- do you explain your estimates,
test results, etc. clearly and correctly?
The paper should be somewhere between 15 and 25 pages or so. These are
guidelines and not hard limits. A very well done 13 page paper is fine
although it will probably be difficult to do what you need to do in 13
pages.
Those of you choosing to write papers for the class need to have your
topic approved by me by Nov. 15.
I hope this helps. Please let me know if you have any questions.
Best,
Kevin
------------------------------------------------------
Kevin Quinn
Assistant Professor
Department of Government and
Center for Basic Research in the Social Sciences
34 Kirkland Street
Harvard University
Cambridge, MA 02138
Hi guys-
For the first problem (1.c), you can simply eyeball the degree to which
the line fits the data. No need to calculate R^2 or the standard error
of the regression by hand.
Alison
> for problem 1c, what is expected for our description of how well the ols
> regression line fits the observed relationship between revenue and
> expenditures? are we just supposed to eyeball it?
>
> or are we supposed to calculated things like the standard error of
> regression and r^2. if so, should we do that by hand?
>
>
Hi Everyone,
Those of you looking for datasets for a final paper will find the HMDC
Virtual Data Center very useful. The URL is:
http://vdc.hmdc.harvard.edu/VDC/index.jsp
The site features a relatively easy to use interface to most of the
major social science data collections (ICPSR, Roper, ROAD, etc). The
coverage is pretty good across most subfields. Many of the datasets
here are quite large so you will probably want to read a dataset's
codebook carefully and then only download a subset of the full
dataset.
If you have questions about using the VDC you can ask either the HMDC
staff, Ryan, Alison, or me.
Best,
Kevin
------------------------------------------------------
Kevin Quinn
Assistant Professor
Department of Government and
Center for Basic Research in the Social Sciences
34 Kirkland Street
Harvard University
Cambridge, MA 02138