Displaying 20 results from an estimated 20000 matches similar to: "limited formula length in tsls"
2013 Jun 23
1
2SLS / TSLS / SEM non-linear
Dear all, I try to conduct a SEM / two stage least squares regression with
the following equations:
First: X ~ IV1 + IV2 * Y
Second: Y ~ a + b X
therein, IV1 and IV2 are the two instruments I would like to use. the
structure I would like to maintain as the model is derived from economic
theory. My problem here is that I have trouble solving the equations to get
the reduced form so I can run
2012 Nov 29
1
instrumental variables regression using ivreg (AER) or tsls (sem)
Dear friends,
I am trying to understand and implement instrumental variables
regression using R.
I found a small (simple) example here which purportedly illustrates the
mechanics (using 2-stage least-squares):
http://www.r-bloggers.com/a-simple-instrumental-variables-problem/
Basically, here are the R commands (reproducible example) from that
site:
# ------ begin R
library(AER)
2000 Nov 19
3
Stataread + R-Devel fails for me
Hi,
I have a problem with R-devel and Stataread 2.5. Stataread installs
(compiles, at gives no error messages). But typing
> library(stataread)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/usr/local/lib/R/library/stataread/libs/stataread.so":
/usr/local/lib/R/library/stataread/libs/stataread.so: undefined symbol: errorcall
Error in
2009 Dec 15
2
Instrumental Variables Regression
Hi there,
I hope to build a model Y ~ X1 + X2 + X3 + X4 with X1 has two
instrumental variable A and B, and X2 has one instrumental variable A. I
have searched the R site and mailling list, and known that the tsls()
from sem package and ivreg() from AER package can deal with instrumental
variable regression, however, I don't know how to formula the model.
Any suggestion will be really
2007 Feb 19
1
Urgent: How to obtain the Consistent Standard Errors after apply 2SLS through tsls() from sem or systemfit("2SLS") without this error message !!!!!!!!!!!!!
Hi,
I am trying to obtain the heteroskedasticity consitent standard errors
(HCSE) after apply 2SLS. I obtain 2SLS through tsls from package sem or
systemfit:
#### tsls ####
library (sem)
Reg2SLS <-tsls(LnP~Sc+Ag+Ag2+Var+R+D,~I2+Ag+Ag2+Var+R+D)
summary (Reg2SLS)
#### systemfit ####
library (systemfit)
RS <- LnP~Sc+Ag+Ag2+Var+R+D
Inst <- ~I2+Ag+Ag2+Var+R+D
labels
2000 Oct 30
5
Newbie questions
Hi,
I am new to R, but a fairly `old' user of Stata. I read posts asking about
survey methods and large datasets in the archive, so I will not ask those
questions again. But some still remain:
- R seems to consume more memory given the same set of data, say if I have
only a data frame defined, than Stata. Am I right if I think that this is
because the object oriented nature of R and can
2000 Oct 30
5
Newbie questions
Hi,
I am new to R, but a fairly `old' user of Stata. I read posts asking about
survey methods and large datasets in the archive, so I will not ask those
questions again. But some still remain:
- R seems to consume more memory given the same set of data, say if I have
only a data frame defined, than Stata. Am I right if I think that this is
because the object oriented nature of R and can
2000 Nov 10
3
NLS
Hello,
I try to do a very simple nonlinear regression. The function is
y = (b0 + b1*x1 + b2*x2 + b3*x3) * x4^b4
I think I do everything well, but as I set the starting value of b4 to 0 (it
is the theoretically sane starting value), it converges very quickly, and to
the wrong solution. Wrong in a sense, that 1) we do not expect this and 2) we
do not get this on E-Views, Stata and SAS. I do not
2013 May 17
2
How could I see the source code of functions in an R package?
Hi,
How could I see the source code of functions in an R package?
If we type ?function_name , we will see documentations of the
function_name.
If we type function_name, is what returns just the source code? Could we
just save it in an .R file and modify as we want? However, it seems that
sometimes the source code is hidden (or stored elsewhere?) As an example,
could we see the source
2001 Feb 27
1
Generate temporary objects or not?
Dear all,
Playing with a toy problem, I wondered how much it costs to generate
`internal' objects in a function that are not strictly needed. An example:
mean(apply(t(matrix(as.vector(x) - x0 / h, , nrow=nrow(x), ncol=ncol(x))), c(2) epakern, dim)) / h^dim
It would be more _readable_ if I defined the object inside the apply(), stick
it there and rm() after, but my feeling is that creating
2001 Jul 18
1
hypothesis testing in models
Dear all,
Being an economics student, I am trying to put together a little
tutorial/FAQ/... for those who have (more) background in econometrics rather
than in statistics -- just as I have. I'v been looking for a hypothesis
testing tool in R (just linear or also nonlinear) for model parameters, but
could not find anything so far. I did find a similar but unanswered question
in the archives,
2013 Jan 29
3
how to suppress the intercept in an lm()-like formula method?
I'm trying to write a formula method for canonical correlation analysis,
that could be called similarly to lm() for
a multivariate response:
cancor(cbind(y1,y2,y3) ~ x1+x2+x3+x4, data=, ...)
or perhaps more naturally,
cancor(cbind(y1,y2,y3) ~ cbind(x1,x2,x3,x4), data=, ...)
I've adapted the code from lm() to my case, but in this situation, it
doesn't make sense to
include an
2001 Jul 19
1
after R 1.3: can not write to or create directory `~/lib/R'
Dear all,
I am running
platform i386-pc-linux-gnu
arch i386
os linux-gnu
system i386, linux-gnu
status
major 1
minor 3.0
year 2001
month 06
day 22
language R
and have my own library path set up having
R_LIBS='~/lib/R'; export
2009 May 12
0
R^2 extraction and autocorrelation/heterokedasticity on TSLS regression
Hi,
I'm actually I’m performing a TSLS linear multiple regression on annually data which go from 1971 to 1997. After performing the TSLS regression, I tried to extract the R squared value using “output$r.squared” function and to perform autocorrelation (Durbin Watson and Breush Godfrey) and heterokedasticity tests (Breush-pagan and Goldfeld Quandt) but I have errors messages. More
2009 May 29
1
Error messages/systemfit package
Hello !
I’m trying to estimate a system of equation (demand and supply) using the systemfit package. My program is:
library(systemfit)
demand <- tsyud ~ tsyud1 + tsucp + tspo + tssn
supply <- tscn ~ tsyn + tsqn + tsksn + tsucp
system <- list(demand=eqdemand, learning = eqsupply)
labels <- list(demand="eqdemand", learning="eqsupply")
inst <- ~ tsupp1 + tsupp2
2007 Apr 09
1
Dealing with large nominal predictor in sem package
Hi,
I am using tsls function from sem package to estimate a model which includes large number of data. Among its predictors, it has a nominal data which has about 10 possible values. So I expand this parameter into 9-binary-value predictors with the coefficient of base value equals 0. I also have another continuous predictor.
The problem is that, whenever I run the tsls, I will get 'System
2013 Apr 12
2
model frame and formula mismatch in model.matrix()
Hello everyone,
I am trying to fit the following model
All X. variables are continuous, while the conditions are categoricals.
model <- lm(X2
2010 Dec 16
1
defining a formula method for a weighted lm()
In the vcdExtra package on R-Forge, I have functions and generic methods
for calculating log odds ratios
for R x C x strata tables. I'd like to define methods for fitting
weighted lm()s to the resulting loddsratio objects,
but I'm having problems figuring out how to do this generally.
# install.packages("vcdExtra", repos="http://R-Forge.R-Project.org")
2000 Oct 06
1
Formulae with factors that have missing values
Hi All,
I have a formula which has a factor with NAs in it. I wish to keep
these in the model matrix, but the NA information is currently lost (the
rows are kept but the NA gets converted to 0). Any ideas as to how
I can keep NAs in?
e.g.
junk <-
2013 Mar 19
0
Epple and McCallum TSLS example
Hello,
I am trying to replicate the "missing example" of a TSLS estimation in
Epple & McCallum (link below)
http://wpweb2.tepper.cmu.edu/facultyadmin/upload/ppaper_32774807225408_Epple-McCallum93.pdf
According to them, the commands are in:
http://www.tepper.cmu.edu/faculty-research/faculty-pages/dennis-epple/simultaneous-equation-econometrics/index.aspx
They use the Stata's