# Forum: help

Monitor Forum | Start New ThreadRE: systemfit 3SLS with panel data [ reply ] By: Arne Henningsen on 2014-08-14 06:36 | [forum:41373] |

Dear Maximilian Thank you for providing a reproducible example. This is really helpful. I will try to fix it asap. Cheers, Arne |

RE: systemfit 3SLS with panel data [ reply ] By: Maximilian Mayer on 2014-08-08 13:24 | [forum:41341] |

the same is actually also true for the Greenfeld data. Again a minimal example: data( "GrunfeldGreene" ) library( plm ) GGPanel <- plm.data( GrunfeldGreene, c( "firm", "year" ) ) equ=capital~value greene=systemfit(equ, "SUR", pooled=T, data=GGPanel) summary(greene) inst=~invest greene3sls=systemfit(equ, "3SLS", inst=inst, pooled=T, data=GGPanel) |

RE: systemfit 3SLS with panel data [ reply ] By: Maximilian Mayer on 2014-08-08 12:56 | [forum:41339] complete_growth2.txt (149) downloads |

Thanks a lot for your immediate help. Here is a very minimal example, which should illustrate the problem. growth=plm.data(data, c("panel","country")) equ1=gro~log(rgdch)+secondary+lexec+lfert+ki+kg+I(inf/100)+oenk+rol+ uds_mean+I(uds_mean^2)+imfloan-1 inst=~secondary+lexec+lfert+oenk+rgdch_lag+kg_lag+ki_lag+rol+ uds_mean+imfloan test=systemfit(equ1, "3SLS", pooled=T, inst=inst, data=growth) |

RE: systemfit 3SLS with panel data [ reply ] By: Arne Henningsen on 2014-08-08 11:46 | [forum:41338] |

Dear Maximilian Please check if the number of observations in inst is equal to those in equ. I am currently not sure what systemfit() does if there are NAs in inst or equ. It would help a lot to figure out the problem, if you could provide a reproducible example, e.g. with randomly generated data if your data set is confidential. Best regards, Arne |

systemfit 3SLS with panel data [ reply ] By: Maximilian Mayer on 2014-08-08 11:34 | [forum:41337] |

Hi, I' trying to fit a 3SLS model to some panel data. Everything works fine using SUR, but when I want to use the instruments there are problems with the numbers of observations in the equation and the instruments. It seems as though systemfit regards the initial formula as panel data and estimates one equation for each period, but not the instrument equation. I have a dataset that like this: data=plm.data(A,B,C,D,E,F,G) where A denotes a time index and B the different individuals. I have used the plm.data function to ket systemfit know I'm using panel data I estimate: equ=C~D+E systemfit(equ, "SUR", data=data, pooled=T) This works and an equation is estimated for each period. But using instruments isn't. equ=C~D+E inst=~F+G systemfit(equ, "3SLS", inst=inst, data=data, pooled=T) Now I get the error message that the number of observations in inst is not equal to those in equ). Can somebody help me? Thanks Max |