search for: kmenta

Displaying 13 results from an estimated 13 matches for "kmenta".

Did you mean: menta
2005 Dec 02
3
masked from package:base?
I am confused by the following description in http://www.maths.lth.se/help/R/.R/library/systemfit/html/hausman.systemfit.html what does the "Not run" mean? if we do not load systemfit, how can we run the following code? ## Not run: library( systemfit ) data( kmenta ) attach( kmenta ) ... I install the package of systemfit, and run the code. I got the warning: > library( systemfit ) > data( kmenta ) > attach( kmenta ) The following object(s) are masked from package:base : q [[alternative HTML version deleted]]
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
...to MLE in R by Macro Steenbergen http://artsci.wustl.edu/~jmonogan/computing/r/MLE_in_R.pdf Any comments are welcome. In particular I would like to know why the estimate of sigma2 is so different. I would also like to know about the accuracy of the coefficient estimates. ## ols ols <- lm(Kmenta$consump ~ Kmenta$price + Kmenta$income) coef(summary(ols)) ## mle y <- matrix(Kmenta$consump) x <- cbind(1, Kmenta$price, Kmenta$income) ols.lf <- function(theta, y, x) { N <- nrow(y) K <- ncol(x) beta <- theta[1:K] sigma2 <- theta[K+1] e <- y - x%*%beta logl &l...
2005 May 25
3
Problem with systemfit 0.7-3 and transformed variables
...imitation, I was just surprised when I attempted to estimate a model, which I'd previously estimated with OLS using 'lm', with 2SLS using 'systemfit' and it didn't accept those transformations like 'lm' does. Here's an example: this is, of course, OK: > data(kmenta) > demand <- q ~ p + d > instr <- ~ d + f > fit1 <- systemfit("2SLS", eqns=list(demand), inst=instr, data=kmenta) But, now if I'd like to estimate a model with logarithm of p as a regressor, an error occurs: > demand2 <- q ~ log(p) + d > fit2 <- system...
2009 Aug 18
3
R formula
Hi I was trying to estimate simultaneous equation system in R using systemfit. I used the following commands >library(systemfit) > data(Kmenta) > attach(Kmenta) >eqDemand<-consump~price+income > eqSupply<-consump~price+farmprice+trend > fitsur<-systemfit("SUR",list(demand=eqDemand, supply=eqSupply)) and got the following error messege Error in systemfit("SUR", list(demand = eqDemand, supply = eqS...
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
...ion. I know using nlm for a linear model isn't the "optimal" method, but I would like to make sure the parameter estimates and the se's are matching before I attempt more difficult problems. rm(list=ls(all=TRUE)) print( "running nlsystemfit models test at end...") data( kmenta ) attach( kmenta ) ##demand2 <- q ~ d0 + d1 * p + d2 * d supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a ##system2 <- list( demand2, supply2 ) ##labels <- list( "Demand", "Supply" ) ##inst <- ~ d + f + a ##sv2 <- c(d0=3,s2=2.123,d2=4,s0=-2.123,s3=4.234,d1=4.234,s1...
2004 Nov 29
3
systemfit - SUR
Hello to everyone, I have 2 problems and would be very pleased if anyone can help me: 1) When I use the package "systemfit" for SUR regressions, I get two different variance-covariance matrices when I firstly do the SUR regression ("The covariance matrix of the residuals used for estimation") and secondly do the OLS regressions. In the manual for "systemfit" on page
2012 Oct 28
6
Hausman test in R
Hi there, I am really new to statistics in R and statistics itself as well. My situation: I ran a lot of OLS regressions with different independent variables. (using the lm() function). After having done that, I know there is endogeneity due to omitted variables. (or perhaps due to any other reasons). And here comes the Hausman test. I know this test is used to identify endogeneity. But what I
2012 Mar 21
1
How to do 2SLS in R
...al stock GD = measure of geographic dispersion of output Here, Equation (1) & (3) are just identified but equation (2) is underidentified My question is: How to carry out 2sls? l have read rhelp wrt to 2sls, example provided over there is summary(tsls(Q ~ P + D, ~ D + F + A, data=Kmenta)) # demand equation But I still do not have clear idea how to write 2SLS command in R wrt to the example l have mentioned .Can you help me providing the syntax wrt to model which l have mentioned? Regards, Priya Saha [[alternative HTML version deleted]]
2003 Sep 30
1
can't get names from vector in nlm calls
...d1 * p + d2 * d supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a system2 <- list( demand2, supply2 ) sv2 <- c(d0=3,d2=4,d1=4.234,s0=-2.123,s2=2.123,s3=4.234,s1=0.234) ### call the nlm function to get the estimates... estnew <- nlm( knls, sv2, hessian=TRUE, print.level=1, eqns=system2, data=kmenta, fitmethod="OLS" ) My question is why can't I simply call names on the vector (sv2) that is passed into the nlm function to get the parameters? Thanks, Jeff. --- Jeff D. Hamann Hamann, Donald and Associates, Inc. PO Box 1421 Corvallis, Oregon USA 97339-1421 (office) 541-754-1428...
2003 Oct 06
1
getting names of p vector in nlm function...
...d1 * p + d2 * d supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a system2 <- list( demand2, supply2 ) sv2 <- c(d0=3,d2=4,d1=4.234,s0=-2.123,s2=2.123,s3=4.234,s1=0.234) ### call the nlm function to get the estimates... estnew <- nlm( knls, sv2, hessian=TRUE, print.level=1, eqns=system2, data=kmenta, fitmethod="OLS" ) My question is why can't I simply call names on the vector (sv2) that is passed into the nlm function to get the parameters? I was assuming that the names, if available, are always present no matter where they get passed. Is that not correct? Optim give the same re...
2002 Mar 29
2
Output from examples in help files
I have a large number of troff help files which are automatically converted to .Rd files. Many of these have examples which contain the printed output of the examples. This makes example(functionname) not work. Is there a way to avoid removing all this output by delimiting it in some way such that the output will not appear in R-ex? Secondly, it would be nice if there was a place where output
2007 Aug 16
0
summarising systemfit with saveMemory
...the McElroy's measure of fit unless it's NULL. When the option saveMemory = TRUE, the McElroy isn't included, instead it defaults to NA. Thus I am unable to use summary.systemfit. > library(systemfit) > example(systemfit) > surfit2 <- systemfit("SUR",system,data=Kmenta,saveMemory=T) > summary(surfit2) As far as I can tell, this is a result of the following code. > print.summary.systemfit <<--SNIP-->> if (!is.null(x$mcelr2)) { cat("McElroy's R-squared value for the system: ") cat(formatC(x$mcelr2, digits = digits, width = -1)) c...
2004 Apr 16
5
Non-Linear Regression (Cobb-Douglas and C.E.S)
Dear all, For estimating Cobb-Douglad production Function [ Y = ALPHA * (L^(BETA1)) * (K^(BETA2)) ], i want to use nls function (without linearizing it). But how can i get initial values? ------------------------------------ > options(prompt=" R> " ) R> Y <- c(59.6, 63.9, 73.5, 75.6, 77.3, 82.8, 83.6, 84.9, 90.3, 80.5, 73.5, 60.3, 58.2, 64.4, 75.4, 85, 92.7, 85.4,