On 22-03-2012, at 09:15, priya.s...@zycus.com wrote: > Hi List > > l am interested in developing price model. I have found a research paper > related to price model of corn in US market where it has taken demand & > supply forces into consideration. Following are the equation: > Supply equation: > St= a0+a1Pt-1+a2Rt-1+a3St-1+a5D1+a6D2+a7D3+U1 -(1) > Where D1,D2,D3=Quarterly Dummy Variables(Since quarterly data are > considered) > Here, Supply equation has 1 endogenous (St) & 6 exogenous variables (P > t-1,Rt-1,St-1,D1,D2,D3) > Demand Side: > Demand of corn is divided into 3 equations: > Feed equation: > Ft=b0+b1Pt+b2P(sm)t+b3Bt+b4COFt+b5Ht+a6D1+a7D2+a8D3+U2 -(2) > here there are 2 endogenous variable(Ft, Pt) & 7 exogenous variables > (P(sm)t,Bt,COFt,D1,D2,D3) > Export equation: > EXt= c0+c1Pt+c2EXt-1+c3Wt+c4DXt+c5GDPt+c6D1+c7D2+c8D3+U3 -(3) > here there are 2 endogenous variable(EXt, Pt) & 7 exogenous variables (EX > t-1,Wt,DXt,D1,D2,D3) > Food, Alcohol, Industry (FAI) Demand Equation: > FAIt= d0+d1Pt+d2Etht+d3Popt+d4Tt+d5D1+d6D2+d7D3+U4 -(4) > here there are 2 endogenous variable(FAIt, Pt) & 6 exogenous variable(Eth > t,Popt,Tt,D1,D2,D3) > Price Equation: price of corn is determined by supply and demand > simultaneously, following is the reduced form equation: > Pt=µ0+µ1St+µ2Ft+µ3EXt+µ4FAIt+µ5Pt-1+µ6D1+µ7D2+µ8D3+U5 -(5) > here there are 5 endogenous variable(St, Ft,EXt, FAIt, Pt) & 4 exogenous > variable(Pt-1,D1,D2,D3) > Now my question is : > By applying 3SLS in the price equation, it will show the impact of > variables on Pt which are mentioned in equation (5).But if l want to find > impact of ETHt from equation (4) on Pt , l'll have to substitute equation > (1),(2),(3),(4) in price equation(5), which manually becomes very tedious, > is there any way this could be done directly in R?
Your system can be written compactly as St = + zS Ft = b1Pt + zF EXt = c1Pt + zEX FAIt= d1Pt + zFAI Pt = µ2Ft+µ3EXt+µ4FAIt + zP St is exogenous so can be ignored. The system is linear and can be written as where the zXXX are the exogenous terms of the equation for XXX. ( Ft ) ( 0 0 0 b1 ) ( Ft ) ( zF ) ( EXt ) = ( 0 0 0 c1 ) ( EXt ) + ( zEX ) ( FAIt ) ( 0 0 0 d1 ) ( FAIt ) ( zFAI ) ( Pt ) ( µ2 µ3 µ4 0 ) ( Pt ) ( zP ) (Note: read the stacked ( and ) as a single large ( or )) or y = A %*% y + z which can be written as y = solve(diag(4)-A) %*% z You only need to construct the matrix A. Berend ______________________________________________ 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.