Your example is too complicated for me. But few points:
1) What do you mean by "instrument"? Do you mean variable?
2) diff(demand) is identical to demand[-1] - demand[-204]
3) system() is a built-in R function, so avoid using it as variable name
4) The variable "yd" is in the eqInvest formula and subsequently to the
system formula. The variable "y.1" is in the instruments formula. Both
formulas are passed onto systemfit() call. Thus I see no surprises here.
Try simplifying and rephrasing please if you want further help.
Regards, Adai
Skipper Seabold wrote:
Hello all,
I hope this question is appropriate for this ML.
Basically, I am wondering if when you create a new variable, if the
variable holds some information about how it was created.
Let me explain, I have the following code to replicate an example in a
textbook (Greene's Econometric Analysis), using the systemfit package.
dta <-
read.table('http://pages.stern.nyu.edu/~wgreene/Text/Edition6/TableF5-1.txt',
header = TRUE)
attach(dta)
library(systemfit)
demand <- realcons + realinvs + realgovt
c.1 <- realcons[-204]
y.1 <- demand[-204]
yd <- demand[-1] - y.1
eqConsump <- realcons[-1] ~ demand[-1] + c.1
eqInvest <- realinvs[-1] ~ tbilrate[-1] + yd
system <- list( Consumption = eqConsump, Investment = eqInvest)
instruments <- ~ realgovt[-1] + tbilrate[-1] + c.1 + y.1
# 2SLS
greene2sls <- systemfit( system, "2SLS", inst = instruments,
methodResidCov = "noDfCor" )
When I do the 2SLS fit, it seems that even though I declared y.1 as an
instrument that the estimator "knows" that yd was created using y1, so
it (correctly) transforms yd to use the instrument in the final
estimation.
So I'm wondering if yd somehow carries knowledge of how it was created.
Thanks,
Skipper
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.