Re: [R] 2SLS / TSLS / SEM non-linear

2013-06-30 Thread hck
Dear Arne Generally I would have the following equations X_i = IV3_i + IV4_i * Y_i applying for every company (i). In a first step, I am interested in estimating the relationship between X and Y: Y_i = a + b * X_i + u to ultimatly estimate X_i by substituting the Y_i and solving for X_i to be able

Re: [R] 2SLS / TSLS / SEM non-linear

2013-06-30 Thread hck
Thank you John and Paul, I started having a look into the systemfit. Basically, my two equations are: 1. Y = IV1 + IV2 x X 2. Y = a + b x X + u where Y and X are the two endogenous variables, IV1 and IV2 are the instruments, and u is the error term. -- View this message in context: http://r

Re: [R] 2SLS / TSLS / SEM non-linear

2013-06-29 Thread hck
The challenge is to firstly calculate the reduced form. As far as I know, the SEM package does not do this automatically. Am I correct? -- View this message in context: http://r.789695.n4.nabble.com/2SLS-TSLS-SEM-non-linear-tp4670123p4670595.html Sent from the R help mailing list archive at N

[R] 2SLS / TSLS / SEM non-linear

2013-06-23 Thread hck
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.

Re: [R] Speed up code with for() loop

2011-04-29 Thread hck
Barth sent me a very good code and I modified it a bit. Have a look: Error<-rnorm(1000, mean=0, sd=0.05) estimate<-(log(1+0.10)+Error) DCF_korrigiert<-(1/(exp(1/(exp(0.5*(-estimate)^2/(0.05^2))*sqrt(2*pi/(0.05^2 ))*(1-pnorm(0,((-estimate)/(0.05^2)),sqrt(1/(0.05^2))-1)) DCF_verzerrt<-(1/(e

Re: [R] plot several histograms with same y-axes scaling using hist()

2011-04-29 Thread hck
Thanks for the note: Indeed, the function is the hist() function not Hist() with capital letter. I use the standard R hist()-function with the lower case only. Nevertheless, the ylim does not work as supposed to. -- View this message in context: http://r.789695.n4.nabble.com/plot-several-histog

[R] plot several histograms with same y-axes scaling using hist()

2011-04-29 Thread hck
Dear all Problem: hist()-function, scale = “percent” I want to generate histograms for changing underlying data. In order to make them comparable, I want to fix the y-axis (vertical-axis) to, e.g., 0%, 10%, 20%, 30% as well as to fix the spaces, too. So the y-axis in each histogram should be iden

[R] Speed up code with for() loop

2011-04-28 Thread hck
Hallo everybody, I'm wondering whether it might be possible to speed up the following code: Error<-rnorm(1000, mean=0, sd=0.05) estimate<-(log(1.1)-Error) DCF_korrigiert<-(1/(exp(1/(exp(0.5*(-estimate)^2/(0.05^2))*sqrt(2*pi/(0.05^2))*(1-pnorm(0,((-estimate)/(0.05^2)),sqrt(1/(0.05^2))-1)