Cost Data for US Airlines
USAirlines.RdCost data for six US airlines in 1970–1984.
Usage
data("USAirlines")Format
A data frame containing 90 observations on 6 variables.
- firm
factor indicating airline firm.
- year
factor indicating year.
- output
output revenue passenger miles index number.
- cost
total cost (in USD 1000).
- price
fuel price.
- load
average capacity utilization of the fleet.
Source
Online complements to Greene (2003). Table F7.1.
https://pages.stern.nyu.edu/~wgreene/Text/tables/tablelist5.htm
References
Greene, W.H. (2003). Econometric Analysis, 5th edition. Upper Saddle River, NJ: Prentice Hall.
Examples
data("USAirlines")
## Example 7.2 in Greene (2003)
fm_full <- lm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load + year + firm,
data = USAirlines)
fm_time <- lm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load + year,
data = USAirlines)
fm_firm <- lm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load + firm,
data = USAirlines)
fm_no <- lm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load, data = USAirlines)
## Table 7.2
anova(fm_full, fm_time)
#> Analysis of Variance Table
#>
#> Model 1: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load +
#> year + firm
#> Model 2: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load +
#> year
#> Res.Df RSS Df Sum of Sq F Pr(>F)
#> 1 66 0.17257
#> 2 71 1.03470 -5 -0.86213 65.945 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(fm_full, fm_firm)
#> Analysis of Variance Table
#>
#> Model 1: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load +
#> year + firm
#> Model 2: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load +
#> firm
#> Res.Df RSS Df Sum of Sq F Pr(>F)
#> 1 66 0.17257
#> 2 80 0.26815 -14 -0.095584 2.6112 0.004582 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(fm_full, fm_no)
#> Analysis of Variance Table
#>
#> Model 1: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load +
#> year + firm
#> Model 2: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load
#> Res.Df RSS Df Sum of Sq F Pr(>F)
#> 1 66 0.17257
#> 2 85 1.27492 -19 -1.1023 22.189 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
## alternatively, use plm()
library("plm")
usair <- pdata.frame(USAirlines, c("firm", "year"))
fm_full2 <- plm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load,
data = usair, model = "within", effect = "twoways")
fm_time2 <- plm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load,
data = usair, model = "within", effect = "time")
fm_firm2 <- plm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load,
data = usair, model = "within", effect = "individual")
fm_no2 <- plm(log(cost) ~ log(output) + I(log(output)^2) + log(price) + load,
data = usair, model = "pooling")
pFtest(fm_full2, fm_time2)
#>
#> F test for twoways effects
#>
#> data: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load
#> F = 65.945, df1 = 5, df2 = 66, p-value < 2.2e-16
#> alternative hypothesis: significant effects
#>
pFtest(fm_full2, fm_firm2)
#>
#> F test for twoways effects
#>
#> data: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load
#> F = 2.6112, df1 = 14, df2 = 66, p-value = 0.004582
#> alternative hypothesis: significant effects
#>
pFtest(fm_full2, fm_no2)
#>
#> F test for twoways effects
#>
#> data: log(cost) ~ log(output) + I(log(output)^2) + log(price) + load
#> F = 22.189, df1 = 19, df2 = 66, p-value < 2.2e-16
#> alternative hypothesis: significant effects
#>
## More examples can be found in:
## help("Greene2003")