There are many functions contained in this package and it can get annoying to have to keep checking documentation. The purpose of this article is to provide templates for the basic features of each function. That way, you can simply copy the template and edit where need be.
Installation and Preparations
This package comes pre-installed on the GVSU Posit Workbench. All you need to do is load the package to access its functions.
Note: The Software Investigation starter program will always include
a code chunk that loads the gvsu215
package that includes
the functions we need for STA215.
Templates
The package’s functions can be broken down into a few general
categories: utilities, tables, plots, and inference. The templates below
are broken up by GVSU’s STA 215 textbook chapter and will include a
generic example template. To evaluate, simply copy the code chunk (click
on the copy icon that appears when you hover your mouse over the code
chunk), double click on the “filler code” (the text in all capital
letters and surrounded by underscores, _EXAMPLE_
) and
replace them with your respective code.
Utilities
Chapter 2: Categorical Data
Chapter 3: One Quantitative
Percentile
Note: Replace percentiles with the values you want separated by
commas. For example, c(0.80, 0.90, 0.95)
Chapter 5: Estimation
Note: Confidence levels default to 95% but can be overridden with
conf_lvl = _DECIMAL_
(e.g.,
conf_lvl = 0.9
).
Chapter 6: Two Quantitative
Scatterplot
Note: Change to axis_lines = "both"
to grid the
scatterplot. Note: Change to ls_line = "show"
to plot the
regression line.
Chapter 7: Hypothesis Testing Introduction
Confidence Interval for the Difference in Two Proportions
Note: Confidence levels default to 95% but can be overridden with
conf_lvl = _DECIMAL_
(e.g.,
conf_lvl = 0.90
).
infer_2prop_int(_DATANAME_, _RESPONSE_~_EXPLANATORY_, success = "_SUCCESSCATEGORY_", conf_lvl = _CONFIDENCELEVEL_)
Note: For this code to work the explanatory variable must only have two categories.
Chapter 8: Hypothesis Testing Means
Paired -Test and Confidence Interval
Note: Confidence levels default to 95% but can be overridden with
conf_lvl = _DECIMAL_
(e.g.,
conf_lvl = 0.90
).
Use the mu0
argument to specify the value of the null
hypothesis, if different from 0. E.g., mu0 = 3
.
Independent -Test
Use the null
argument to specify the value of the null
hypothesis, if different from 0. E.g., null = 3
.