Libraries to Import
library(tidyverse) |
library(broom) |
library(mosaic) |
library(dplyr) |
Block 2 Quiz 1
mutually exclusive |
two cannot be concurrent |
independent |
no relevance/influence between 2 factors |
complement |
opposite |
rbinom(# of trials, # of attempts within trial, success rate) mean( results > amt) |
returns probability of success that the amt is exceeded |
mean(rbinom(simulatedTrials, #ofAttempts, successRate)) |
favstats(results) |
finding 3rd quartile of probability |
quantile(results, 0.75) |
qbinom(0.75, size = #ofAttempts, prob = successRate) |
choose(n, k) |
n choose k. different ways for result |
Block 1 GR
Categorical |
non-number |
Numerical |
can be categorized 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 |
observational study |
not experimenting |
retrospective study |
data collected after the fact |
prospective study |
data collected during event |
skew |
tail is what skew it is |
favstats(colforeachof~thiscol, data = dataSet) |
returns min, max, SD, mean, median |
explanatory variable |
x |
response variable |
y |
independence has no trend |
tally(~col1+col2, data = dataSet, format = "percent/decimal" |
% of the dataset that applies to both |
tally((colforeachof~thiscol, data = dataSet, format = "percent", margin = TRUE) |
of col1, how many also in col2? |
dataSet%>% gf_props(Survived, fill = Pclass, position = "fill")%>% gf_labs(title = "", subtitle = "", x = "", y = "")%>% gf_theme(theme_bw()) |
Block 1 GR
Categorical |
non-number |
Numerical |
can be categorized 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 |
observational study |
not experimenting |
retrospective study |
data collected after the fact |
prospective study |
data collected during event |
skew |
tail is what skew it is |
favstats(colforeachof~thiscol, data = dataSet) |
returns min, max, SD, mean, median |
explanatory variable |
x |
response variable |
y |
independence has no trend |
tally(~col1+col2, data = dataSet, format = "percent/decimal" |
% of the dataset that applies to both |
tally((colforeachof~thiscol, data = dataSet, format = "percent", margin = TRUE) |
of col1, how many also in col2? |
dataSet%>% |
|
|
Block 2 Quiz 2
pnorm(value, mean mu, stdev) |
returns CDF of normal distribution |
Probability of randomly selecting within a range |
upper bound pnorm - lower bound pnorm |
qnorm(percentile value, mu, stdev) |
returns percentile of dataset |
integrate(function(x){functionInfo}, lowerBound, upperBound)$value |
Integrate |
adaptIntegrate(function, lowerLimit = c(lowerBound, lowerBoundY), upperLimit = c(upperBoundX, upperBoundY))$integral |
integrate with 2 variables |
Cov(X,Y) = E(XY) - E(X)E(Y) |
covariance |
Cov(X,Y) = 0 |
Independence |
CDF |
cumulative density function. probability that a random variable will take on a value <= given value. integral of PDF |
PDF |
proability density function. probability that a random variable will take on a given value. derivative of CDF. |
rexp(# of trials, mu) + 1 /// mean(results < givenNumber) |
exponential distribution |
pexp(xValueNumber, rate = mu) |
exponential distribution |
Block 3
lm() |
im not done with this! |
bootstrapping |
|
|
|