Hi! I am trying yo run a regression using the plm package. I tried in two different ways, that should give the same result, but eventually do not; and i cannot understand the reason.
- The first way: Accellerator.model <- read.delim("~/Desktop/Tesi/Accellerator model.txt") data <- Accellerator.model Panel <- plm.data(Accellerator.model,index=c("ID","Year")) y <- data$Net.Cap.Inv p <- data$Oil.Price rev <- data$Revenue ebi <- data$EBITDA tas <- data$Tot.Assets fas <- data$Non.current tas1 <- data$tas1 rev1 <- data$rev1 rev2 <- data$rev2 fas1 <- data$fas1 cap1 <- data$cap1 # FIXED 1 fixed <- plm(y~fas1+rev+rev1+p,data=pdata,model="within") summary(fixed) Oneway (individual) effect Within Model Call: plm(formula = y ~ fas1 + rev + rev1 + p, data = pdata, model = "within") Unbalanced Panel: n=19, T=6-19, N=282 Residuals : Min. 1st Qu. Median 3rd Qu. Max. -91.6000 -8.4600 0.0711 7.1000 110.0000 Coefficients : Estimate Std. Error t-value Pr(>|t|) fas1 -0.0231717 0.0096980 -2.3893 0.017595 * rev 0.0922257 0.0035990 25.6251 < 2.2e-16 *** rev1 0.0127055 0.0058961 2.1549 0.032093 * p 0.1587968 0.0579552 2.7400 0.006571 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Total Sum of Squares: 804760 Residual Sum of Squares: 178290 R-Squared : 0.77845 Adj. R-Squared : 0.71496 F-statistic: 227.513 on 4 and 259 DF, p-value: < 2.22e-16 > - The second way: Accellerator.model <- read.delim("~/Desktop/Tesi/Accellerator model.txt") data <- plm.data(Accellerator.model,index=c("ID","Year")) data$y <- data$Net.Cap.Inv data$p <- data$Oil.Price data$rev <- data$Revenue data$ebi <- data$EBITDA data$tas <- data$Tot.Assets data$fas <- data$Non.current Panel <- data fixed <- plm(y~fas1+rev+rev1+p,data=Panel,model="within") summary(fixed) Oneway (individual) effect Within Model Call: plm(formula = y ~ fas1 + rev + rev1 + p, data = Panel, model = "within") Unbalanced Panel: n=19, T=9-19, N=296 Residuals : Min. 1st Qu. Median 3rd Qu. Max. -75.200 -3.710 -0.604 3.150 80.000 Coefficients : Estimate Std. Error t-value Pr(>|t|) fas1 0.0892306 0.0066033 13.5131 < 2.2e-16 *** rev 0.0120747 0.0111825 1.0798 0.2812 rev1 0.0419186 0.0095914 4.3704 1.764e-05 *** p 0.0078837 0.0375021 0.2102 0.8337 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Total Sum of Squares: 774610 Residual Sum of Squares: 85942 R-Squared : 0.88905 Adj. R-Squared : 0.81997 F-statistic: 546.893 on 4 and 273 DF, p-value: < 2.22e-16 As you can see, the results are totally different, and I have no explanation for that! Thanks for the help Regards. Luca. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.