within_min {xtsum}R Documentation

Compute the minimum within-group for panel data

Description

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

Usage

within_min(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 minimum 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 minimum within-group effect.

Examples

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

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


[Package xtsum version 0.1.0 Index]