between_sd {xtsum} | R Documentation |
Compute the standard deviation of between-group
Description
This function calculates the standard deviation of between-group in a panel data.
Usage
between_sd(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 standard deviation of between-group effects 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 standard deviation of between-group effects.
Examples
# Example using pdata.frame
data("Gasoline", package = "plm")
Gas <- pdata.frame(Gasoline, index = c("country", "year"), drop.index = TRUE)
between_sd(Gas, variable = "lgaspcar")
# Using regular data.frame with id and t specified
data("Crime", package = "plm")
between_sd(Crime, variable = "crmrte", id = "county", t = "year")
[Package xtsum version 0.1.0 Index]