| grunfeld | R Documentation |
Panel data on gross investment for 11 US firms over 20 years (1935–1954),
originally from Grunfeld (1958). This is a classic panel dataset used for
validating the IPCA estimator against the Python ipca package
(Kelly, Pruitt, Su, 2019).
grunfeld
A data.frame with 220 rows and 5 variables:
Character; firm name (11 unique firms).
Integer; year of observation (1935–1954).
Numeric; gross investment (millions of dollars).
Numeric; market value of the firm (millions of dollars).
Numeric; stock of plant and equipment (millions of dollars).
Grunfeld, Y. (1958). The Determinants of Corporate Investment.
Ph.D. thesis, Department of Economics, University of Chicago.
Loaded from the statsmodels Python package
(statsmodels.datasets.grunfeld).
Kelly, B. T., Pruitt, S., and Su, Y. (2019). Characteristics are Covariances: A Unified Model of Risk and Return. Journal of Financial Economics, 134(3), 501–524. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jfineco.2019.05.001")}
head(grunfeld)
# Reshape for ipca_est(): T x N matrix and T x N x L array
firms <- sort(unique(grunfeld$firm))
years <- sort(unique(grunfeld$year))
N <- length(firms)
TT <- length(years)
ret <- matrix(NA, TT, N)
Z <- array(NA, dim = c(TT, N, 2))
for (i in seq_along(firms)) {
idx <- grunfeld$firm == firms[i]
ret[, i] <- grunfeld$invest[idx]
Z[, i, 1] <- grunfeld$value[idx]
Z[, i, 2] <- grunfeld$capital[idx]
}
fit <- ipca_est(ret, Z, nfac = 1)
print(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.