# 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")
Run the code above in your browser using DataLab