Package 'rcistats'

Title: R Tools for CSU Channel Islands
Description: An R package containing functions for statistics courses at CSUCI.
Authors: c( person("Isaac", "Quintanilla Salinas", role = c("aut","cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-1137-4310")) )
Maintainer: Isaac Quintanilla Salinas <[email protected]>
License: MIT + file LICENSE
Version: 0.1.4
Built: 2026-05-31 07:01:08 UTC
Source: https://github.com/inqs909/rcistats

Help Index


Obtain the adjusted R-Squared Value from a Linear Model

Description

Obtain the adjusted R-Squared Value from a Linear Model

Usage

ar2(object)

Arguments

object

An R object that is a 'formula' or contains the results of the 'lm' function.


Extract regression coefficients from a linear regression model.

Description

The regression coefficients demonstrates how a set of predictor variables will affect the outcome of interest.

Usage

b(object, index = NULL, data = NULL)

Arguments

object

An R object that is a formula or contains the results of the 'lm' function.

index

Index indicating which coefficients to obtain.

data

A data frame when the object is a formula.


Obtain the Bottom X Percents

Description

Obtain the Bottom X Percents

Usage

bottom(x, probs)

Arguments

x

Vector

probs

Probability


Obtain Frequencies and Proportions for a Categorical Variable

Description

Obtain Frequencies and Proportions for a Categorical Variable

Usage

cat_stats(x, y = NULL, prop = "all", tbl_df = FALSE, digits = 4)

Arguments

x

Vector

y

Vector for Cross-tabulations.

prop

Character indicating what type of proportions to provide. Defaults to "all".

tbl_df

Logical indicating if you need a df for a single variable for a pie chart or other things.

digits

number of decimal places to round


Obtain Descriptive Statistics from a data frame.

Description

Obtain Descriptive Statistics from a data frame.

Usage

descriptive(df)

Arguments

df

An R data frame used for further analysis.


Extract the F Statistic

Description

Extract the F Statistic

Usage

f(object)

Arguments

object

An R object that is a 'formula' or contains the results of the 'lm' function.


A function that creates a pie chart.

Description

A function that creates a pie chart.

Usage

geom_pie(mapping = NULL, data = NULL, position = "stack", ..., width = 1)

Arguments

mapping

Aesthetics created by aes().

data

The data used to create the plot.

position

Set to "stack" for the pie chart.

...

A set of arguments passed down to geom_bar().

width

Set to 1 for the pie chart.

Value

A ggplot from the displays the pie chart.


Install R packages used for Math 201

Description

Install R packages used for Math 201

Usage

install_m201()

Install ggplots and other plotting packages

Description

Install ggplots and other plotting packages

Usage

install_plots()

Install Themes

Description

Install Themes

Usage

install_themes()

Repeat a task numerous times

Description

Repeat a task numerous times

Usage

iterate(expr, sim)

Arguments

expr

Expression to be evaluated multiple times.

sim

The number of times to evaluate an the expression.


Extract model information for linear regression.

Description

Extract model information for linear regression.

Usage

linear_model_info(model)

Arguments

model

An R object that results from a linear regression model.

Value

A message model information.


Extract model information for logistic regression

Description

Extract model information for logistic regression

Usage

logistic_model_info(model)

Arguments

model

An R object that results from a logistic regression model (glm class).

Value

A message indicating which category is being modeled as success from the logistic regression model.


Obtain the middle X Percent

Description

Obtain the middle X Percent

Usage

middle(x, probs)

Arguments

x

Vector

probs

Probability


Extract model information

Description

Extract model information

Usage

model_info(model)

Arguments

model

An R object that results from a logistic regression model (glm class).

Value

A message indicating which category is being modeled as success from the logistic regression model.


Obtain Numerical Statistics for a Continuous Variable by a Categorical Variable

Description

Obtain Numerical Statistics for a Continuous Variable by a Categorical Variable

Usage

num_by_cat_stats(df, num, cat)

Arguments

df

An R data frame used for further analysis.

num

Name of the numerical variable found in the data frame

cat

Name of the categorical variable found in the data frame


Obtain Numerical Statistics for a Continuous Variable

Description

Obtain Numerical Statistics for a Continuous Variable

Usage

num_stats(x, tbl = TRUE, digits = 3)

Arguments

x

A numerical or integer vector.

tbl

A logical indicating whether to return a tibble or not, defaults to TRUE.

digits

number of decimal places to round


props Computing proportions

Description

Compute the proportions of observing a value from a 2 by 2 continguency table

Usage

props(x, y, yval, diff = FALSE)

Arguments

x

grouping variable

y

outcome of interest

yval

category of interest from outcome of interest

diff

Obtain the difference in proportions. Default is FALSE.


Obtain the R-Squared Value from a Linear Model

Description

Obtain the R-Squared Value from a Linear Model

Usage

r2(object)

Arguments

object

An R object that is a 'formula' or contains the results of the 'lm' function.


Sample a data frame with replacement

Description

Sample a data frame with replacement

Usage

resample(df)

Arguments

df

Data frame to be sampled with replacement


Extract Residuals and Influential Measures from 'glm' and 'lm' object

Description

Extract Residuals and Influential Measures from 'glm' and 'lm' object

Usage

resid_df(object)

Arguments

object

An R object that contains the results of the 'lm' or 'glm' function.


Extract the standard errors of the regression coefficients from a linear regression model.

Description

The standard errors of the regression coefficients demonstrates the variability of the relationship between the predictor variables and the outcome of interest.

Usage

se_b(object, index = NULL, data = NULL)

Arguments

object

An R object that is a formula or contains the results of the 'lm' function.

index

Index indicating which coefficients to obtain.

data

A data frame when the object is a formula.


Reorder the data of a vector

Description

Reorder the data of a vector

Usage

shuffle(x)

Arguments

x

A vector to be shuffle the order of the values.


Compute the sum of error squared for an R object

Description

Compute the sum of error squared for an R object

Usage

sse(object, data = NULL)

Arguments

object

An R object that is a 'formula' or contains the results of the 'lm' function.

data

A data frame when the object is a formula.


Obtain the top X Percent

Description

Obtain the top X Percent

Usage

top(x, probs)

Arguments

x

Vector

probs

Probability


Creates a Unicorn Data Set from simulated models.

Description

Creates a Unicorn Data Set from simulated models.

Usage

unicorns(n)

Arguments

n

Number of unicorns used