W.numSummary | R Documentation |
W.numSummary
gives the main statistical summary for weighted variables (mean, standard deviation, coefficient of variation, skewness, kurtosis and quantiles). It also allows the partition of the data by a factor variable.
W.numSummary(data,
statistics = c("mean", "sd", "se(mean)", "IQR",
"quantiles", "cv", "skewness", "kurtosis"),type = c("2", "1", "3"),
quantiles = c(0, 0.25, 0.5, 0.75, 1),groups = NULL, weights)
data |
|
statistics |
any of |
type |
definition to use in computing skewness and kurtosis; see the |
quantiles |
quantiles to report; by default is |
groups |
optional variable, typically a factor, to be used to partition the data. By default is |
weights |
numeric vector of weights. Zero values are allowed. |
W.numSummary
performs a descriptive analysis of quantitative variables weighted (or not) by a numeric variable which determines the importance of each subject in the data frame. Optionally it allows the partition of the data by a factor variable (groups
).
Note that, unlike the numSummary
function, the sample standard deviation is calculated instead of the sample standard quasideviation.
An object with class "numSummary"
.
numSummary
, skewness
, kurtosis
.
data(cars93)
# no weighted
W.numSummary(data=cars93[,c("CityMPG")], statistics =c("mean", "sd", "IQR", "quantiles"),
quantiles = c(0,0.25,0.5,0.75,1), weights=NULL, groups=NULL)
# weighted
W.numSummary(data=cars93[,c("CityMPG")], statistics =c("mean", "sd", "IQR", "quantiles"),
quantiles = c(0,0.25,0.5,0.75,1), weights=cars93$FuelCapacity, groups=NULL)
# no weighted
W.numSummary(data=cars93[,c("CityMPG")], statistics =c("mean", "sd", "IQR", "quantiles"),
quantiles = c(0,0.25,0.5,0.75,1), weights=NULL, groups=cars93$Manual)
# weighted
bb <- W.numSummary(data=cars93[,c("CityMPG")], statistics =c("mean", "sd", "IQR", "quantiles"),
quantiles = c(0,0.25,0.5,0.75,1), weights=cars93$FuelCapacity, groups=cars93$Manual)
bb
str(bb)
class(bb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.