plot_residuals {getspanel} | R Documentation |
Plot Residuals from 'isatpanel' against OLS
Description
Plot Residuals from 'isatpanel' against OLS
Usage
plot_residuals(isatpanelobject)
Arguments
isatpanelobject |
An output from the 'isatpanel' function |
Value
A ggplot2 plot that plots an 'isatpanel' object and shows the residuals over time in comparison to an OLS model.
Examples
data(EU_emissions_road)
# Group specification
EU15 <- c("Austria", "Germany", "Denmark", "Spain", "Finland", "Belgium",
"France", "United Kingdom", "Ireland", "Italy", "Luxembourg",
"Netherlands", "Greece", "Portugal", "Sweden")
# Prepare sample and data
EU_emissions_road_short <- EU_emissions_road[
EU_emissions_road$country %in% EU15 &
EU_emissions_road$year >= 2000,
]
# Run
result <- isatpanel(
data = EU_emissions_road_short,
formula = ltransport.emissions ~ lgdp + I(lgdp^2) + lpop,
index = c("country", "year"),
effect = "twoways",
fesis = TRUE,
plot = FALSE,
t.pval = 0.01
)
plot(result)
plot_residuals(result)
[Package getspanel version 0.2.0 Index]