SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Problem with SUR using systemfit [ reply ]
By: Tejendra Pratap Singh on 2017-10-23 09:16
[forum:45401]

image1.jpg (17) downloads
Also the model is attached in the image.

RE: Problem with SUR using systemfit [ reply ]
By: Tejendra Pratap Singh on 2017-10-23 06:23
[forum:45399]

image 5.jpg (16) downloads
And I am trying to replicate the table attached.

RE: Problem with SUR using systemfit [ reply ]
By: Tejendra Pratap Singh on 2017-10-23 06:21
[forum:45398]

TableF10-2.csv (5) downloads
Yes Sir,
The code is here:

rm(list=ls())

costdata= read.csv("TableF10-2.csv")
library(tidyverse)
costdata= costdata %>%
mutate(lnpkpm= log(costdata$Pk)/log(costdata$Pm)) %>%
mutate(lnplpm= log(costdata$Pl)/log(costdata$Pm)) %>%
mutate(lnpepm= log(costdata$Pe)/log(costdata$Pm)) %>%
mutate(sk= (costdata$K*costdata$Pk)/costdata$Cost) %>%
mutate(sl= (costdata$L*costdata$Pl)/costdata$Cost) %>%
mutate(se= (costdata$E*costdata$Pe)/costdata$Cost)

View(costdata)
library(systemfit)

eqn_cpaital= sk~ lnpkpm+ lnplpm+ lnpepm
eqn_labour= sl~ lnpkpm+ lnplpm+ lnpepm
eqn_energy= se~ lnpkpm+ lnplpm+ lnpepm
system1=list(capital= eqn_cpaital, labour= eqn_labour, energy= eqn_energy)

#SUR
costdata_SUR= systemfit(system1, method = "SUR", data = costdata, methodResidCov= "noDfCor", pooled = TRUE, residCovWeighted = TRUE )
summary(costdata_SUR)

The data file is attached.

RE: Problem with SUR using systemfit [ reply ]
By: Arne Henningsen on 2017-10-23 05:52
[forum:45397]
Please make available here the data and code that you used -- and make sure that the code is executable.

RE: Problem with SUR using systemfit [ reply ]
By: Tejendra Pratap Singh on 2017-10-21 21:06
[forum:45391]
I tried that but the estimates do not match with that in book. The same issue crops up when i am trying to estimate other models which ask for FGLS estimates when certain coefficients are restricted to be equal as in this problem.
I hope for a reply.

RE: Problem with SUR using systemfit [ reply ]
By: Arne Henningsen on 2017-10-21 20:19
[forum:45390]
User "terence" has pointed out the mistakes in your code:

https://community.rstudio.com/t/pooled-model-sur/2124/9

Problem with SUR using systemfit [ reply ]
By: Tejendra Pratap Singh on 2017-10-21 19:35
[forum:45389]
My issue is listed here.
Any help is appreciated.

https://community.rstudio.com/t/pooled-model-sur/2124

Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge