Learn R Programming

xtsum (version 0.1.0)

between_max: Compute the maximum between-group

Description

This function calculates the maximum between-group in a panel data.

Usage

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

Value

The maximum between-group effect.

Arguments

data

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

variable

The variable for which the maximum between-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.

Examples

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

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

Run the code above in your browser using DataLab