Description Usage Arguments Value Author(s) See Also Examples
The function calculates a linear model by calling lm(xi~classvar)
for all numeric variables (xi
) from x
and returns the coefficients of determination. The aim is to find numeric variables for which high ratios of the variability can be explained by a factor variable classvar
.
1 |
data |
A data frame. |
classvar |
A factor. The variable which is used to explain the numeric variables from |
If x
is a numeric vector, the coefficient of determination of the model described by lm(x~classvar)
is returned. Otherwise a data frame with the following two variables:
groups |
coefficient of determination. |
variable |
actual variable. |
Katrin Grimm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(Election2005)
## Not run:
# Define new variable which explains affiliation of the constituencies
# to east Germany, west Germany and Berlin
OstWest <- ifelse(Election2005$Land %in%
c("Thueringen","Sachsen","Sachsen-Anhalt",
"Brandenburg","Mecklenburg-Vorpommern"), "Ost", "West")
Election2005$OstWestBerlin <-
as.factor(ifelse(Election2005$Land == "Berlin","Berlin",OstWest))
# Calculate measure groups
groupm <- groups(Election2005, "OstWestBerlin")
# Show highest values
groupm[with(groupm,order(groups,decreasing=TRUE))[1:10],]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.