This isn't exactly what we're looking for. Suppose that when you plot
the hypothetical raw data (x,y) using
plot(x,y)
it looks like Y is roughly equal to log(X) plus random noise. Then
transforming the x variable to be log(x) should result in a roughly
linear relationship
plot(log(x), y)
Obviously if the relationship is not logarithmic this transformation
won't work, but you get the idea.
Let me know if this is not clear.
Hope this helps.
Best,
Kevin
> I'm trying to graph the transformations in 1. I've consulted the book and
> section notes, but I'm not sure if I'm correct. For 1a, I have the following
> code for the transformation:
> library(car)
> library(mgcv)
> data(Sahlins)
> s2<-na.omit(Sahlins)
> attach(s2)
> par(mfrow=c(2,2))
> lm.out2<-lm(log(consumers)~acres+(acres)^2)
> qq.plot(lm.out2, main="Linear transformation of Consumers to Acres")
>
> I get a linear relationship, but I'm not sure this is the format
> you're looking for...?
>
Hi guys,
How can we interpret the coefficients/significance of the results of
models in which you have both eg x1 and x1^2 (as in lecture slide 390).
With simple numerical models it makes sense, but how should we best
interpret if we think that we need to include, say, both population over
75 and population over 75 squared?
thanks
Lucy
How does one get White SE if the hccm.lm() required unweighted lm (see below)?
Or, are we supposed to compare White's from 3D to the SE's in 3C?
The question isn't clear.
library(car)
data(Ornstein)
attach(Ornstein)
lm.out<-lm(interlocks~sqrt(assets) + sector + nation)
lm.out2<-lm(interlocks~assets+sector+nation, weights=1/sqrt(assets))
newse<-sqrt(diag(hccm(lm.out2)))
Error in hccm.lm(lm.out2) : requires unweighted lm
comparison<-cbind(coef(summary(lm.out2))[,2], newse)
Thanks!
Marie
Hi,
This question is not realted to Gov1000 homework but is a general question
about manipulating data in R for a paper I am doing for another class.
Sample portion of data:
> ustenure <- read.csv("ustenure.csv", header=T)
> ustenure
industry tenure.year tud
1 Agriculture and related industries 4.2 2.8
2 Mining 4.5 8.7
3 Construction 3.0 16.7
4 Manufacturing, durable goods 5.5 15.6
5 Manufacturing, nondurable goods 5.3 13.1
So, I plot my data and use the "identify" function to try and name
the data points:
identify(ustenure$tenure.year, ustenure$tud, row.names=T)
Unfortunately, because I have the generic row of numbers (1, 2, 3,
4, 5), the data points are identified with the number, when I want them
identified by industry name. Anyone know how I can remove the column of
numbers or better specify in the identify command how to identify by
industry?
I'm been working on this a while and consulting past homeworks and can't
get this resolved........
Thanks!
Becky
Hi guys-
For those of you who were planning on attending the Thurs. section next
week, please let me know (individually) if one of the following would be
possible for you:
-attending the Tues. 4pm section
-attending a section or office hour on Fri. at 2pm
Thanks very much-
Alison
hi all,
i don't know how i managed to do it, but whenever i hit 'enter' in R, it
takes me down to the next line, but about 5 spaces in - not at the start
of the line.
anyone know how to fix that?
thanks,
michael
Hi Matt-
Thanks for pointing this out.
In 3.d, we are referring to the OLS regression with the untransformed
dependent variable (interlocks) from part a. This will allow you to
compare your standard errors from the original OLS regression with White
standard errors, and standard errors calculated under WLS in part c. (the
latter two also have untransformed dependent variables.)
-best
Alison
On Thu, 2 Dec 2004, Matthew Walter Landauer wrote:
> Alison,
>
> sorry to pepper you with yet another question, but a good deal of problem
> 3 is unclear. Question 3d refers to "the OLS regression you ran in a)
> above." Since we ran two regressions in a), do we compare the new
> standard errors to the errors from the first regression in a), to the ones
> from the second regression in a), or to both?
>
> thanks,
>
> Matt
>
Hi, folks. If those who were having trouble loading lattice could try
again now and let me know the results, I'd appreciate it.
Thanks,
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/
Hello everybody-
I was just wondering if anyone else can't load the lattice library (on
their Xdesktop) any more:
>library(lattice)
Error in library(lattice) : There is no package called 'lattice'
or is it just me?
Lucy