Package 'estprod'

Title: Estimation of Production Functions
Description: Estimation of production functions by the Olley-Pakes, Levinsohn-Petrin and Wooldridge methodologies. The package aims to reproduce the results obtained with the Stata's user written opreg <http://www.stata-journal.com/article.html?article=st0145> and levpet <http://www.stata-journal.com/article.html?article=st0060> commands. The first was originally proposed by Olley, G.S. and Pakes, A. (1996) <doi:10.2307/2171831>. The second by Levinsohn, J. and Petrin, A. (2003) <doi:10.1111/1467-937X.00246>. And the third by Wooldridge (2009) <doi:10.1016/j.econlet.2009.04.026>.
Authors: Rodrigo R Remédio [aut, cre]
Maintainer: Rodrigo R Remédio <[email protected]>
License: GPL-3
Version: 1.2
Built: 2025-03-06 02:46:38 UTC
Source: https://github.com/cran/estprod

Help Index


Combination with repetition.

Description

From combinatorial math, this function aims calculates combinations with repetitions.

Usage

combination_with_repetition(n, r)

Arguments

n

The number of elements (variables).

r

The size of the groups (degreess of the polynomial interaction).


10000 randomly generated variables in panel data format.

Description

10000 randomly generated variables in panel data format.

Usage

estprod_data

Format

A data frame with 10000 rows and 10 variables:

id

Identifies the 1000 randomly generated individuals.

year

The year associated to each individual observation.

g1

Put individuals in 25 groups.

g2

Put individuals in 50 groups.

var1

Randomly generated variable.

var2

Randomly generated variable.

var3

Randomly generated variable.

var4

Randomly generated variable.

var5

Randomly generated variable.

exit

The last year an id appears.


Levinsohn-Petrin Estimation of Production Functions

Description

This function aims the estimation of production functions using Levinsohn-Petrin (2000).

Usage

levinsohn_petrin(
  data,
  formula = y ~ free | capital | proxy | controls,
  exit = NULL,
  gross = FALSE,
  id = "id",
  time = "year",
  bootstrap = TRUE,
  reps = 2,
  degree = c(3, 3),
  verify = TRUE,
  maxiter = 100,
  ...
)

Arguments

data

A data.frame or tibble containing the variables of the model.

formula

An object of the class formula.

exit

An optional formula with the name of the variabe indicator of firm's last period. ~exit, for example.

gross

If TRUE dependent variable is gross output.

id

A character with the name of the indicator variable.

time

A character with the name of the time variable.

bootstrap

An optional logical. If TRUE calculate bootstrap standard errors.

reps

The number of bootstrap replications.

degree

A vector with the number of polynomial interactions in each stage of the routine.

verify

Verify if inputs are sorted.

maxiter

Parameter of nls.lm at second stage.

...

Additional arguments.

Details

Multipart formula must be specified in the following order: y ~ free | capital | proxy | controls. Additional controls are optional. It is possible to use more than one variable, although the use of more than one capital may not be theoretically identified. The function returns an object of the estprod or boot classes (if bootstrap is TRUE).

Examples

data(estprod_data)
levinsohn_petrin(data = estprod_data, var1 ~ var2 | var3 | var4, 
exit = ~exit, id = "id", time = "year", bootstrap = TRUE)

Olley-Pakes Estimation of Production Functions

Description

This function aims the estimation of production functions using Olley-Pakes (1996).

Usage

olley_pakes(
  data,
  formula = y ~ free | capital | proxy | controls,
  exit = NULL,
  id = "id",
  time = "year",
  bootstrap = TRUE,
  reps = 2,
  degree = c(3, 2),
  verify = TRUE,
  maxiter = 100,
  ...
)

Arguments

data

A data.frame or tibble containing the variables of the model.

formula

An object of the class formula.

exit

An optional formula with the name of the variabe indicator of firm's last period. ~exit, for example.

id

A character with the name of the indicator variable.

time

A character with the name of the time variable.

bootstrap

An optional logical. If TRUE calculate bootstrap standard errors.

reps

The number of bootstrap replications.

degree

A vector with the number of the polynomial interactions in each stage of the routine.

verify

Verify if inputs are sorted.

maxiter

Parameter of nls.lm at second stage.

...

Additional arguments.

Details

Multipart formula must be specified in the following order: y ~ free | capital | proxy | controls. Additional controls are optional. It is possible to use more than one variable, although the use of more than one capital may not be theoretically identified. The function returns an object of the estprod or boot classes (if bootstrap is TRUE).

Examples

data(estprod_data)
olley_pakes(data = estprod_data, var1 ~ var2 | var3 | var4, 
exit = ~exit, id = "id", time = "year", bootstrap = TRUE)

Panel data lag function

Description

This function aims create the lags of a specified variable from panel data.

Usage

panel_lag(x, id, time, lag = 1, verify = TRUE)

Arguments

x

A vector, data.frame, tibble or matrix.

id

A character with the name of the indicator variable.

time

A character with the name of the time variable.

lag

Number of lags.

verify

Check if panel is sorted by id and time variables.

Note

Based on Paul Schrimpf's lag function.


Number of poly elements.

Description

This function aims calculate the number of terms of a polynomial interactions.

Usage

poly_elements(n, d)

Arguments

n

The number of variables.

d

Degreess of polynomial interaction.


Wooldridge Estimation of Production Functions (Cobb-Douglas)

Description

This function aims the estimation of Cobb-Douglas production functions using Wooldridge (2009) method.

Usage

wooldridge(
  data,
  formula = y ~ free | capital | proxy | controls,
  gross = FALSE,
  id = "id",
  time = "year",
  bootstrap = FALSE,
  reps = 2,
  degree = c(3, 2),
  verify = TRUE,
  ...
)

Arguments

data

A data.frame or tibble containing the variables of the model.

formula

An object of the class formula.

gross

If TRUE dependent variable is gross output.

id

A character with the name of the indicator variable.

time

A character with the name of the time variable.

bootstrap

An optional logical. If TRUE calculate bootstrap standard errors.

reps

The number of bootstrap replications.

degree

A vector with the number of the polynomial interactions in each stage of the routine.

verify

Verify if inputs are sorted.

...

Additional arguments.

Details

Multipart formula must be specified in the following order: y ~ free | capital | proxy | controls. Additional controls are optional. It is possible to use more than one variable, although the use of more than one capital may not be theoretically identified. The function returns an object of the estprod or boot classes (if bootstrap is TRUE).

Examples

data(estprod_data)
wooldridge(data = estprod_data, var1 ~ var2 | var3 | var4, 
id = "id", time = "year", bootstrap = TRUE)