| 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 |
Obtain the adjusted R-Squared Value from a Linear Model
ar2(object)ar2(object)
object |
An R object that is a 'formula' or contains the results of the 'lm' function. |
The regression coefficients demonstrates how a set of predictor variables will affect the outcome of interest.
b(object, index = NULL, data = NULL)b(object, index = NULL, data = NULL)
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
bottom(x, probs)bottom(x, probs)
x |
Vector |
probs |
Probability |
Obtain Frequencies and Proportions for a Categorical Variable
cat_stats(x, y = NULL, prop = "all", tbl_df = FALSE, digits = 4)cat_stats(x, y = NULL, prop = "all", tbl_df = FALSE, digits = 4)
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.
descriptive(df)descriptive(df)
df |
An R data frame used for further analysis. |
Extract the F Statistic
f(object)f(object)
object |
An R object that is a 'formula' or contains the results of the 'lm' function. |
A function that creates a pie chart.
geom_pie(mapping = NULL, data = NULL, position = "stack", ..., width = 1)geom_pie(mapping = NULL, data = NULL, position = "stack", ..., width = 1)
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. |
A ggplot from the displays the pie chart.
Install R packages used for Math 201
install_m201()install_m201()
Install ggplots and other plotting packages
install_plots()install_plots()
Repeat a task numerous times
iterate(expr, sim)iterate(expr, sim)
expr |
Expression to be evaluated multiple times. |
sim |
The number of times to evaluate an the expression. |
Extract model information for linear regression.
linear_model_info(model)linear_model_info(model)
model |
An R object that results from a linear regression model. |
A message model information.
Extract model information for logistic regression
logistic_model_info(model)logistic_model_info(model)
model |
An R object that results from a logistic regression model (glm class). |
A message indicating which category is being modeled as success from the logistic regression model.
Obtain the middle X Percent
middle(x, probs)middle(x, probs)
x |
Vector |
probs |
Probability |
Extract model information
model_info(model)model_info(model)
model |
An R object that results from a logistic regression model (glm class). |
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
num_by_cat_stats(df, num, cat)num_by_cat_stats(df, num, cat)
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
num_stats(x, tbl = TRUE, digits = 3)num_stats(x, tbl = TRUE, digits = 3)
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 |
Compute the proportions of observing a value from a 2 by 2 continguency table
props(x, y, yval, diff = FALSE)props(x, y, yval, diff = FALSE)
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
r2(object)r2(object)
object |
An R object that is a 'formula' or contains the results of the 'lm' function. |
Sample a data frame with replacement
resample(df)resample(df)
df |
Data frame to be sampled with replacement |
Extract Residuals and Influential Measures from 'glm' and 'lm' object
resid_df(object)resid_df(object)
object |
An R object that contains the results of the 'lm' or 'glm' function. |
The standard errors of the regression coefficients demonstrates the variability of the relationship between the predictor variables and the outcome of interest.
se_b(object, index = NULL, data = NULL)se_b(object, index = NULL, data = NULL)
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
shuffle(x)shuffle(x)
x |
A vector to be shuffle the order of the values. |
Compute the sum of error squared for an R object
sse(object, data = NULL)sse(object, data = NULL)
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
top(x, probs)top(x, probs)
x |
Vector |
probs |
Probability |
Creates a Unicorn Data Set from simulated models.
unicorns(n)unicorns(n)
n |
Number of unicorns used |