within_max: Compute the maximum within-group for a panel data

View source: R/xtwithin.R

within_maxR Documentation

Compute the maximum within-group for a panel data

Description

This function computes the maximum within-group for a panel data.

Usage

within_max(data, variable, id = NULL, t = NULL, na.rm = FALSE)

Arguments

data

A data.frame or pdata.frame object containing the panel data.

variable

The variable for which the maximum within-group effect is calculated.

id

(Optional) Name of the individual identifier variable.

t

(Optional) Name of the time identifier variable.

na.rm

Logical. Should missing values be removed? Default is FALSE.

Value

The maximum within-group effect.

Examples

# Example using pdata.frame
data("Gasoline", package = "plm")
Gas <- pdata.frame(Gasoline, index = c("country", "year"), drop.index = TRUE)
within_max(Gas, variable = "lgaspcar")


# Using regular data.frame with id and t specified
data("Crime", package = "plm")
within_max(Crime, variable = "crmrte", id = "county", t = "year")


xtsum documentation built on June 22, 2024, 7 p.m.