Package 'csucistats'

Title: CSU Channel Islands R Tools
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.4.0
Built: 2025-02-02 06:12:01 UTC
Source: https://github.com/inqs909/csucistats

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", df = FALSE, 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".

df

Logical indicating to provide a tibble for cross tabulations with table proportions.

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.


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.


Obtain the middle X Percent

Description

Obtain the middle X Percent

Usage

middle(x, probs)

Arguments

x

Vector

probs

Probability


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 and 'lm' object

Description

Extract Residuals and Influential Measures from and 'lm' object

Usage

resid_df(object)

Arguments

object

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


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


Unicorn Data

Description

A simulated dataset about unicorns used for teaching purposes.

Usage

unicorn_data

Format

A data frame with 750 rows and 15 variables:

Unicorn_ID

A unique id number

Age

age in years

Gender

The gender of the unicorn (Female, Male, Non-Binary, Genderfluid, Agender)

Color

Color (White, Black, Gray, Brown, Pink, Gold, Silver

Type_of_Unicorn

What type of unicorn is it? (Rainbow, Jewel, Ember, Ruvas)

Type_of_Horn

What type of horn is it? (Opal or Aquamarine)

Horn_Length

Length of the horn (inches)

Horn_Strength

Strength of the Horn (pascals)

Weight

Weight in pounds

Health_Score

Unicorn's overal health (1-10)

Personality_Score

How Personal is the unicorn?

Magical_Score

How magical is the unicorn?

Elusiveness_Score

How elusive is the unicorn?

Gentleness_Score

How gentle is the unicorn?

Nature_Score

How connected to nature is the unicorn?

Source

csucistats csucistats R package.


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