similar to: Hausman test in R

Displaying 20 results from an estimated 600 matches similar to: "Hausman test in R"

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
2011 Jan 16
1
Hausman Test
Hi, can anybody tell me how the Hausman test for endogenty works? I have a simulated model with three correlated predictors (X1-X3). I also have an instrument W for X1 Now I want to test for endogeneity of X1 (i.e., when I omit X2 and X3 from the equation). My current approach: library(systemfit) fit2sls <- systemfit(Y~X1,data=data,method="2SLS",inst=~W) fitOLS <-
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
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
2005 May 25
3
Problem with systemfit 0.7-3 and transformed variables
The 'systemfit' function in systemfit 0.7-3 CRAN package seems to have a problem with formulas that contain transformed (eg. log) variables. If I have my data in a data frame, apparently systemfit doesn't "pass" the information of where the variables should be taken to the transforming function. I'm not entirely sure if this is a bug or just a limitation, I was just
2011 Jan 17
2
How to still processing despite bug errors?
Hi, everybody. I am working processing EEG data from 1000 pacients. I have a specific syntax to perform the Spectral Analysis and a loop to analyse all subjects. each subject data are in separate folders (P1, P2 P3...) My question is: in some cases, some errors can appear in one subject. I want to know if is possible to jump to the next subject and perform the same syntax , exibiting an error
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
Hi everyone, I am looking to do some manual maximum likelihood estimation in R. I have done a lot of work in Stata and so I have been using output comparisons to get a handle on what is happening. I estimated a simple linear model in R with lm() and also my own maximum likelihood program. I then compared the output with Stata. Two things jumped out at me. Firstly, in Stata my coefficient
2007 Nov 28
6
How to create data frame from data with unequal length
Hi, I have two sets of data that I would like to put into a data frame. But since they have different length, I am not sure how to do this. Here is an example of my data: data set one: date growth 1/1/2007 10 1/2/2007 10.2 1/3/2007 10.4 1/4/2007 10.6 data set two: date growth 1/1/2007 22 1/2/2007 22.5 1/4/2007 22.4 I would like to combine the two data sets and
2012 Oct 05
11
Calculating the mean in one column with empty cells
Hi all, I recently tried to calculate the mean and the median just for one column. In this column I have numbers with some empty cells due to missing data. So how can I calculate the mean just for the filled cells? I tried: mean(dataSet2$ac_60d_4d_after_ann[!is.na(master$ac_60d_4d_after_ann)], na.rm=TRUE) But the output was different to the calculation I died in Microsoft Excel. Thanks in
2012 Oct 23
2
Export summary from regression output
Hi there, I tried it many times but didn't get it worked. I just want to export the summary of a OLS regression (lm() function) into a csv-file including the "call"-formula", "coefficients", "r-squared", " adjusted r-squared" and "f statistic". I know I can export: write.csv2(Regression_60d_ann$coefficients,
2012 Mar 21
1
How to do 2SLS in R
Hi List I want to carry out structural mode. Following Example l have taken from Basic Econometrics- Damodar Gujarati : Advertising intensity function: Ad/S = a0 + a1M + a2 (CD/S) + a3C + a4C2 + a5Gr + a6Dur – (1) Concentration function: C = b0 + b1 (Ad/S) + b2 (MES/S) -(2) Price-cost margin function: M = c0 + c1(K/S) + c2Gr + c3C + c4GD + c5(Ad/S) + c6 (MES/S)
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
I've been working on a new package and I have a few questions regarding the behaviour of the nlm function. I've been (for better or worse) using the nlm function to fit a linear model without suppling the hessian or gradient attributes in the objective function. I'm curious as to why the nlm requires 31 iterations (for the linear model), and then it doesn't work when I try to add
2006 Aug 09
1
NLS and IV
Hello All, I'm looking to test a variable in a logit model (glm(..., binomial(link="logit"))) for exogeneity (endogeneity). At this point I am planning to try implementing Jeffery Grogger's "A Simple Test for Exogeneity in Probit, Logit, and Poisson Regression Models", Economic Letters, 1990. To do this, I need to be able to do an instrumental variables NLS
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
2008 Oct 14
1
Advice on Computer Specifications
Hello I'm running into a variety of limitations with my computer complaining that it doesn't have sufficient memory. It is a Dell Latitude D630 Duo Core CPU T7700 @ 2.40 GHz, with 3.50 GB RAM. I'm working with relatively large dataframes > dim(AllYears) returns 4071840 records with 13variables sometimes this complains that it can not allocate vectors of 16.0 Mb and will
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
2007 Jul 05
1
(Statistics question) - Nonlinear regression and simultaneous equation
Hi,I have a fundamental questions that I'm a bit confused. If any guru from this circle could help me out, I would really appreciate.I have a system of equations in which some of the endogs appear on right hand sides of some equations. To solve this, one needs a technique like 2SLS or FIML to circumvent inconsistency of the estimated coefficients. My question is that if I apply the nonlinear
2012 Apr 30
1
IV estimation
Hello, I have a set of 100 variables with 1560 observations. I did an O.L.S regression of three of these variables on a fourth. But there are problems of endogeneity... So I look in my dataset for instruments to do an IV. I can't find a good instrument because their correlation with my endogeneous variables are too low. But I see that when I create a combined variable composed of 12 variables
2002 May 30
2
Systems of equations in glm?
I have a student that I'm encouraging to use R rather than SAS or Stata and within just 2 weeks he has come up with a question that stumps me. What does a person do about endogeneity in generalized linear models? Suppose Y1 and Y2 are 5 category ordinal dependent variables. I see that MASS has polr for estimation of models like that, as long as they are independent. But what if the
2002 Feb 12
1
getting quotes out of matrix?
I've trying to check for model bias. It was recommended to me that I should break the residuals into n groups and test to see if the mean is different from zero. What is the best way to generate the groups. I've generated a matrix that contains the residuals and groups, but the values all have quotes around them. 1) how do I get rid of the quotes? 2) is this an acceptable method for