Happy Thanksgiving. In case anyone is working today....
I'm having some troublw with most of 6.
6b & 6C) I'm not sure where to begin on these for R with linear.hypothesis()
6d)
Testing the joint hypothesis that prights5 and civlib5 are both 0 using anova
I get errors:
barro <- read.table("barro.txt", row.names=1, header=T)
attach(barro)
names(barro)
barro.clean<-
na.omit(data.frame(barro$grsh56,barro$invsh55,barro$prights5,barro$civlib5))
detach(barro)
barro.mod.1<-(barro$grsh56~barro$invsh55+barro$prights5+barro$civlib5+type)
barro.mod.0<-(barro$grsh56~barro$invsh55+barro$prights5+barro$civlib5)
anova(barro.mod.1, barro.mod.0)
Error in anova(barro.mod.1, barro.mod.0) :
no applicable method for "anova"
Tips much appreciated :)
Marie
Hi,
I don't know why, but I can't get the same answer for 7b and c,
calculating the test statistic for the hypothesis that the coefficients on
Black and Hispanic are equal.
Here is my code:
##B
> gore.multi <- lm(formula = GoreTherm ~ EconBW + ClintonFR + PID + Black
+ Hisp)
> L <- matrix(c(0, 0, 0, 0, 1, -1), 1, 6)
> b <- coefficients(gore.multi)
> c <- matrix(c(0), 1, 1)
> n <- length(Black)
> one <- matrix(c(1), n, 1)
> X <- matrix(c(one, EconBW, ClintonFR, PID, Black, Hisp), n, 6)
> t(L%*%b -c) %*% (L %*% (t(X)%*%(X))^(-1) %*% t(L))^(-1) %*% (L%*%b -c) /
2*(19.1^2)
[,1]
[1,] 0
##C
> linear.hypothesis(gore.multi, L, c)
F-Test
SS = 274.9 SSE = 591420 F = 0.7573 Df = 1 and 1629 p = 0.3843
I am worried that I my conceptual approach to this is wrong?? Or have I
made a typo??
Happy Thanksgiving,
Becky
For Problem 4, you should certainly include an algebraic discussion of
your answers. Supplementing this discussion with an R-based Monte Carlo
example would be an excellent idea as well.
> It's not exactly clear whether we are supposed to do four in R or just give
> substantive answers. (?)
Hi, folks. Problem Set 5 has been marked, and will be available in your
Littauer mailbox by 9pm. To allow two weeks after the holiday, rewrites
will be due Monday, 13 December. I've indicated on your solution sets the
cases where rewrites will be accepted via email. On the whole, these were
very good solution sets. Notes on the more problematic exercises are
below. Congratulations, and have a great holiday weekend!
Ryan
PS5 Solution Notes
Problem 2. Full credit for finding A^1 by hand. We suggested the
elementary row operations *matrices* technique to try to build intuition
about why the inverse is what it is. Let us know if there are any
questions.
Problem 3. For part d), matrix and vector calculus show that the minimum
occurs at the point x* = y.
Problem 6. Be sure to review the definition of linear (in)dependence. If
any c_i exist that can be multiplied by the vectors in the set to get a
zero vector, then the vectors are linearly dependent. In some cases, like
this one, all 2-dimensional w's are linearly dependent on the first two
vectors.
RTM
------------------------------------------
Ryan T. Moore ~ Government & Social Policy
Ph.D. Candidate ~ Harvard University
Homepage: http://www.people.fas.harvard.edu/~rtmoore/
Gov1000: http://www.courses.fas.harvard.edu/~gov1000/
Hi Everyone,
In light of the fact that we'll be covering generalized additive
models a bit next week, you don't need to read Sections 12.31 and
12.3.2.
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 all-
Just a reminder that I'm having office hour now until 5pm. Feel free to
come by with any questions on the hw.
And in the meantime--happy holidays!
Alison
I'm not having any luck loading the ANES2000.Rdata using the load() command for
problem 7. I've dowloaded the data to my working directory then instructed
>load("ANES2000.Rdata")
I'm getting the following error message:
Error in open.connection(con, "rb") : unable to open connection
In addition: Warning message:
cannot open compressed file `ANES2000.Rdata'
Any ideas??
b
Hi Everyone,
I've made one additional revision to the syllabus. The Beck and
Jackman article on generalized additive models from the last week has
been moved up to next week. I think this makes sense given that
generalized additive models are a very useful way to diagnose and
model nonlinearities which will be an important part of the lecture
next week.
The new syllabus is now up on the course website.
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, everyone. Those rewrites turned in yesterday have been graded and
will be in your Littauer mailboxes by 8.30pm. Nice job on these. If you
have any questions, please let me know. Also, I'll be around CBRSS most
of the day tomorrow, if anyone has questions.
Have a great holiday weekend.
Ryan
------------------------------------------
Ryan T. Moore ~ Government & Social Policy
Ph.D. Candidate ~ Harvard University
Homepage: http://www.people.fas.harvard.edu/~rtmoore/
Gov1000: http://www.courses.fas.harvard.edu/~gov1000/