AgrMcDt {MAINT.Data}R Documentation

Agregate Micro Data

Description

AgrMcDt creates IData objects by agregating a Data Frame of Micro Data.

Usage

AgrMcDt(MicDtDF, agrby, agrcrt="minmax")

Arguments

MicDtDF

A data frame with the original values of the micro data.

agrby

A factor with categories on which the micro data should be aggregated.

agrcrt

The aggregation criterion. Either the ‘minmax’ string, or a two dimensional vector with the prob. value for the left (lower) percentile, followed by the prob. value for the right (upper) percentile, used in the aggregation.

Value

An object of class IData with the data set of Interval-valued variables resulting from the aggregation performed.

See Also

IData

Examples


# Create an Interval-Data object by agregating the microdata consisting 
# of 336776 NYC flights included in the FlightsDF data frame, 
# by the statistical units specified in the FlightsUnits factor.

Flightsminmax <- AgrMcDt(FlightsDF,FlightsUnits)

#Display the first and last observations

head(Flightsminmax)
tail(Flightsminmax)

#Print summary statistics

summary(Flightsminmax)

## Not run: 

# Repeat this procedure using now the 10th and 90th percentiles.

Flights1090prcnt <- AgrMcDt(FlightsDF,FlightsUnits,agrcrt=c(0.1,0.9))

#Display the first and last observations

head(Flights1090prcnt)
tail(Flights1090prcnt)

summary(Flights1090prcnt)


## End(Not run)


[Package MAINT.Data version 2.7.1 Index]