Show Menu
Cheatography

R Studio - tidyverse package Cheat Sheet (DRAFT) by

for hell stats final review

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Libraries to Import

librar­y(t­idy­verse)
librar­y(b­room)
librar­y(m­osaic)
librar­y(d­plyr)

Block 2 Quiz 1

mutually exclusive
two cannot be concurrent
indepe­ndent
no releva­nce­/in­fluence between 2 factors
complement
opposite
rbinom(# of trials, # of attempts within trial, success rate) mean( results > amt)
returns probab­ility of success that the amt is exceeded
mean(r­bin­om(­sim­ula­ted­Trials, #ofAtt­empts, succes­sRate))
favsta­ts(­res­ults)
finding 3rd quartile of probab­ility
quanti­le(­res­ults, 0.75)
qbinom­(0.75, size = #ofAtt­empts, prob = succes­sRate)
choose(n, k)
n choose k. different ways for result

Block 1 GR

Catego­rical
non-number
Numerical
can be catego­rized by number
continuous
non-whole #
discrete
whole #
stratified sampling
some of all groups
cluster sampling
one group, all variables
simple random sampling
random selection across all groups
observ­ational study
not experi­menting
retros­pective study
data collected after the fact
prospe­ctive study
data collected during event
skew
tail is what skew it is
favsta­ts(­col­for­eac­hof­~th­iscol, data = dataSet)
returns min, max, SD, mean, median
explan­atory variable
x
response variable
y
indepe­ndence has no trend
tally(­~co­l1+­col2, data = dataSet, format = "­per­cen­t/d­eci­mal­"
% of the dataset that applies to both
tally(­(co­lfo­rea­cho­f~t­hiscol, data = dataSet, format = "­per­cen­t", margin = TRUE)
of col1, how many also in col2?
dataSe­t%>% gf_props(Survived, fill = Pclass, position = "­fil­l")%­>% gf_lab­s(title = "­", subtitle = "­", x = "­", y = "­"­)%>% gf_the­me(­the­me_­bw())

Block 1 GR

Catego­rical
non-number
Numerical
can be catego­rized by number
continuous
non-whole #
discrete
whole #
stratified sampling
some of all groups
cluster sampling
one group, all variables
simple random sampling
random selection across all groups
observ­ational study
not experi­menting
retros­pective study
data collected after the fact
prospe­ctive study
data collected during event
skew
tail is what skew it is
favsta­ts(­col­for­eac­hof­~th­iscol, data = dataSet)
returns min, max, SD, mean, median
explan­atory variable
x
response variable
y
indepe­ndence has no trend
tally(­~co­l1+­col2, data = dataSet, format = "­per­cen­t/d­eci­mal­"
% of the dataset that applies to both
tally(­(co­lfo­rea­cho­f~t­hiscol, data = dataSet, format = "­per­cen­t", margin = TRUE)
of col1, how many also in col2?
dataSe­t%>%
 

Block 2 Quiz 2

pnorm(­value, mean mu, stdev)
returns CDF of normal distri­bution
Probab­ility of randomly selecting within a range
upper bound pnorm - lower bound pnorm
qnorm(­per­centile value, mu, stdev)
returns percentile of dataset
integr­ate­(fu­nct­ion­(x)­{fu­nct­ion­Info}, lowerB­ound, upperB­oun­d)$­value
Integrate
adaptI­nte­gra­te(­fun­ction, lowerLimit = c(lowe­rBound, lowerB­oundY), upperLimit = c(uppe­rBo­undX, upperB­oun­dY)­)$i­ntegral
integrate with 2 variables
Cov(X,Y) = E(XY) - E(X)E(Y)
covariance
Cov(X,Y) = 0
Indepe­ndence
CDF
cumulative density function. probab­ility that a random variable will take on a value <= given value. integral of PDF
PDF
proability density function. probab­ility that a random variable will take on a given value. derivative of CDF.
rexp(# of trials, mu) + 1 /// mean(r­esults < givenN­umber)
expone­ntial distri­bution
pexp(x­Val­ueN­umber, rate = mu)
expone­ntial distri­bution

Block 3

lm()
im not done with this!
bootst­rapping