descriptives: Descriptive Statistics

Description Usage Arguments Value Author(s) Examples

View source: R/descriptives.R

Description

Descriptive Statistics

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
descriptives(
  X,
  y,
  varnamesX = NULL,
  varnamey = NULL,
  plot = TRUE,
  moments = TRUE,
  cor = TRUE,
  mardia = TRUE
)

Arguments

X

n by k numeric matrix. The data matrix \mathbf{X} (also known as design matrix, model matrix or regressor matrix) is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation on the first column.

y

Numeric vector of length n or n by 1 matrix. The vector \mathbf{y} is an n \times 1 vector of observations on the regressand variable.

varnamesX

Optional. Character vector of length k. Variable names for matrix X.

varnamey

Optional. Character string. Variable name for vector y.

plot

Logical. Display scatter plot matrix.

moments

Logical. Print central moments (means, standard deviations, skewness, and kurtosis).

cor

Logical. Print correlations.

mardia

Logical. Estimate Mardia's multivariate skewness and kurtosis.

Value

Returns a list with the following elements:

X

n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation on the first column.

y

n \times 1 matrix of observations on the regressand variable.

data

n \times k matrix with the following columns y, X_2, X_3, \cdots, X_k.

n

Sample size.

k

Number of regressors which includes a regressor whose value is 1 for each observation on the first column.

p

Number of partial regression coefficients are slopes.

df1

Degrees of freedom 1.

df2

Degrees of freedom 2.

muhatX

Vector of length p of estimated means of X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{μ}}_{\mathbf{X}} = ≤ft\{ \hat{μ}_{X_2}, \hat{μ}_{X_3}, \cdots, \hat{μ}_{X_k} \right\} \right).

muhaty

Estimated mean of the regressand variable ≤ft( \hat{μ}_y \right)

muhat

Vector of length p of estimated means of the regressand variable y and X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{μ}} = ≤ft\{ \hat{μ}_{y}, \hat{μ}_{X_2}, \hat{μ}_{X_3}, \cdots, \hat{μ}_{X_k} \right\} \right).

Rhat

k \times k matrix of estimated correlations ≤ft( \boldsymbol{\hat{R}}_{y, X_{2, 3, \cdots, k}} \right).

Rhat.p

k \times k p-values associated with the estimated correlation matrix.

RXhat

p \times p matrix of estimated correlations between regressor variables ≤ft( \boldsymbol{\hat{R}}_{X_{2, 3, \cdots, k}} \right).

ryXhat

Vector of length p of estimated correlations between the regressand variables and the regressor variables ≤ft( \boldsymbol{\hat{r}}_{y, X_{2, 3, \cdots, k}} = ≤ft\{ \hat{r}_{y, X_2}, \hat{r}_{y, X_3}, \cdots, \hat{r}_{y, X_k} \right\} \right).

Sigmahat

k \times k matrix of estimated covariances ≤ft( \boldsymbol{\hat{Σ}}_{y, X_{2, 3, \cdots, k}} \right).

SigmaXhat

p \times p matrix of estimated covariances between regressor variables ≤ft( \boldsymbol{\hat{Σ}}_{X_{2, 3, \cdots, k}} \right).

sigmayXhat

Vector of length p of estimated covariances between the regressand variables and the regressor variables ≤ft( \boldsymbol{\hat{σ}}_{y, X_{2, 3, \cdots, k}} = ≤ft\{ \hat{σ}_{y, X_2}, \hat{σ}_{y, X_3}, \cdots, \hat{σ}_{y, X_k} \right\} \right).

sigma2Xhat

Vector of length p of estimated variances of X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{σ}}_{X_{2, 3, \cdots, k}}^{2} = ≤ft\{ \hat{σ}_{X_2}^{2}, \hat{σ}_{X_2}^{2}, \cdots \hat{σ}_{X_k}^{2} \right\} \right).

sigma2yhat

Estimated variance of y ≤ft( \hat{σ}_{y}^{2} \right).

sigmaXhat

Vector of length p of estimated standard deviation of X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{σ}}_{X_{2, 3, \cdots, k}} = ≤ft\{ \hat{σ}_{X_2}, \hat{σ}_{X_2}, \cdots \hat{σ}_{X_k} \right\} \right).

sigmayhat

Estimated standard deviation of y ≤ft( \hat{σ}_{y} \right).

sigma2hat

Vector of length k of estimated variances of the regressand variable y and X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{σ}}_{y, X_{2, 3, \cdots, k}}^{2} = ≤ft\{ \hat{σ}_{y}^{2}, \hat{σ}_{X_2}^{2}, \hat{σ}_{X_2}^{2}, \cdots \hat{σ}_{X_k}^{2} \right\} \right).

sigmahat

Vector of length k of estimated standard deviations of the regressand variable y and X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{σ}}_{y, X_{2, 3, \cdots, k}} = ≤ft\{ \hat{σ}_{y}, \hat{σ}_{X_2}, \hat{σ}_{X_2}, \cdots \hat{σ}_{X_k} \right\} \right).

skewhat

Vector of length k of estimated skewness of the regressand variable y and X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{γ}}_{1} = ≤ft\{ \hat{γ}_{1y}, \hat{γ}_{1X_{2}}, \hat{γ}_{1X_{3}}, \cdots, \hat{γ}_{1X_{k}} \right\} \right) .

kurthat

Vector of length k of estimated excess kurtosis of the regressand variable y and X_2, X_3, \cdots, X_k ≤ft( \boldsymbol{\hat{γ}}_{2} = ≤ft\{ \hat{γ}_{2y}, \hat{γ}_{2X_{2}}, \hat{γ}_{2X_{3}}, \cdots, \hat{γ}_{2X_{k}} \right\} \right) .

mardiahat

Vector is estimates of Mardia's multivariate skewness and kurtosis and their associated test statistics and p-values.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Simple regression------------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
X <- X[, c(1, ncol(X))]
y <- jeksterslabRdatarepo::wages.matrix[["y"]]
out <- descriptives(X = X, y = y)
str(out)

# Multiple regression----------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
# age is removed
X <- X[, -ncol(X)]
out <- descriptives(X = X, y = y)
str(out)

jeksterslabds/jeksterslabRlinreg documentation built on Jan. 7, 2021, 8:30 a.m.