descr: descriptive statistics

Version:0.1
Suggests:gmodels, Hmisc
Date:2007-07-09
Author:Jakson A. Aquino. Includes R source code written by Dirk Enzmann.
Maintainer:Jakson Aquino
License:GPL (version 2 or later).
URL:http://jalvesaq.googlepages.com/descr.html

 

Package source: descr_0.1-0.tar.gz

 

This package has some descriptive functions for R that might be useful for social scientists. To install it under Linux, do the following commands or something equivalent:

  wget http://jalvesaq.googlepages.com/descr_0.1-0.tar.gz
  sudo R CMD INSTALL descr_0.1-0.tar.gz
  

 

 


 

 

Documentation for package `descr' version 0.1-0

 

 

compmeans {descr}R Documentation

Means of a numerical vector according to a factor

Description

Calculates the means of a numerical vector according to a factor.

Usage

compmeans(x, y, weight = NULL, digits = 3, sort = FALSE, maxlevels = 100) 

Arguments

x A factor.
y A numeric vector.
weight An optional vector with weights.
digits Precision of output.
sort If TRUE, sorts the lines by the means values.
maxlevels Maximum number of levels that x might have.

Value

A object of class table.

Author(s)

Jakson A. Aquino

 

 


 

 

crosstabs {descr}R Documentation

Cross tabulation

Description

Outputs a cross table for two factors.

Usage

crosstabs(x, y, weight = NULL, digits = 3, max.width = 5, expected=FALSE,
      prop.r=FALSE, prop.c=FALSE, prop.t=FALSE, prop.chisq=FALSE, chisq = FALSE,
      fisher=FALSE, mcnemar=FALSE, resid=FALSE, sresid=FALSE, asresid=FALSE,
      missing.include=FALSE, format=c("SPSS", "SAS"), dnn = NULL)

Arguments

x, y Vectors in a matrix or a dataframe.
weight An optional vector for a weighted cross tabulation.

Details

crosstabs invokes the CrossTable function in the gmodels package with all boolean options set to FALSE and "SPSS" as the default format option.

Author(s)

Jakson A. Aquino

See Also

CrossTable

 

 


 

 

descr {descr}R Documentation

Summary of an object

Description

Wrapper for the function summary of base package, including information about variable label. The function prints the label attribute of the object and, then, invokes summary(object). If the object is a data frame, the functions prints the label and invokes summary for each variable in the data frame.

Usage

descr(x)

Arguments

x The object to be described.

Value

Null.

Author(s)

Jakson Aquino

See Also

summary

 

 


 

 

freq {descr}R Documentation

Frequency table

Description

Prints a frequency table of the selected object. Optionally, the frequency might be weighted.

Usage

freq(x, weight)

Arguments

x The factor from which the frequency of values is desired.
weight An optional vector for a weighted frequency table.

Value

An object of class table.

Author(s)

Dirk Enzmann; weight parameter added by Jakson A. Aquino.

 

 


 

 

fromUTF8 {descr}R Documentation

Conversion from UTF-8 encoding

Description

Converts the encoding of some attributes of an object from UTF-8 into other encoding.

Usage

fromUTF8(x, to = "WINDOWS-1252") 

Arguments

x A R object, usually a variable of a data frame or a data frame.
to A string indicating the desired encoding. Common values are "LATIN1" and "WINDOWS-1252". Type iconvlist() for the complete list of available encodings.

Details

The function converts the attribute label of x from UTF-8 into the specified encoding. If x is a factor, the levels are converted as well. If x is a data.frame, the function makes the conversions in all of its variables.

Value

The object with its label and levels converted.

Author(s)

Jakson A. Aquino

See Also

iconv, label

 

 


 

 

hist.kdnc {descr}R Documentation

Histogram with kernel density and normal curve

Description

Plots a histogram with kernel density and normal curve.

Usage

hist.kdnc(v, breaks = 0, include.lowest = T, right = T, xlab = deparse(substitute(v))) 

Arguments

v The object from which the histogram is desired.
breaks See hist.
include.lowest See hist.
right See hist.
xlab See hist.

Details

The function plots a histogram of the object x with its kernel density and a normal curve with the same mean and standard deviation of x.

Value

NULL.

Author(s)

Dirk Enzmann

 

 


 

 

Latex {descr}R Documentation

LaTeX table

Description

Reads a R object and tries to output a LaTeX table from it.

Usage

Latex(x, caption = NULL, label = NULL, longtable = FALSE) 

Arguments

x A object of class table or that might be converted into table.
caption A string representing the LaTeX table caption.
label A string representing the LaTeX table label.
longtable If TRUE, use \longtable instead of \table in the LaTeX code.

Value

NULL.

Author(s)

Jakson A. Aquino

 

 


 

 

LogRegR2 {descr}R Documentation

Pseudo Rē of logistic regression

Description

The function calculates multiple Rē analogues (pseudo Rē) of logistic regression.

Usage

LogRegR2(model)

Arguments

model A logistic regression model.

Details

The function calculates McFaddens Rē, Cox & Snell Index, and Nagelkerke Index of a logistic regression model.

Value

A object of class list with the calculated indexes.

Author(s)

Dirk Enzmann

Examples

# Suppose that "happy" is a factor and "income" is a numeric vector in a data frame:
## Not run: 
m <- glm(happy ~ income, family=binomial(link="logit"))
LogRegR2(m)
## End(Not run)

 

 


 

 

toUTF8 {descr}R Documentation

Conversion to UTF-8 encoding

Description

Converts the encoding of some attributes of an object to UTF-8

Usage

toUTF8(x, from = "WINDOWS-1252") 

Arguments

x A R object, usually a variable of a data frame or a data frame.
from A string indicating the original encoding. Common values are "LATIN1" and "WINDOWS-1252". Type iconvlist() for the complete list of available encodings.

Details

The function converts the attribute label of x from the specified encoding into UTF-8. If x is a factor, the levels are converted as well. If x is a data.frame, the function makes the conversions in all of its variables.

Value

The object with its label and levels converted.

Author(s)

Jakson A. Aquino

See Also

iconv, label