Final Flashcards
(30 cards)
Binomial Distribution
- is a discrete function
- includes dbinom,rbinom,pbinom,qbinom
- must have a fixed number of trials
- trials must be independent
- must be able to define our outcomes as success/failure
dbinom
- dbinom(x,size,prob)
- can be used to find probability
- P(X=K)
pbinom
pbinom( q,size,prob)
P(X<=K), will return the P
rbinom
rbinom(n,size,prob)
qbinom
qbinom(q,size,prob)
P(X<=K), will return the K
Normal Distribution
- is continuous
- centered at the mean with standard deviation on either side
pnorm
- pnorm(value,mean,sd)
- only computes the area to the left
- pnorm finds the area/probability (we are given Zo)
qnorm
-Finding Zo given a probability
- only works to the left similar to pnorm
rnorm
- rnorm(# of values, mean,sd)
- randomly generates values within the set parameters
dnorm
-creates PDF (probability density function)
- returns the height of any given value
Standard Deviation for Uniform Distribution
(b-a)/sqrt12
dunif
dunif(c,min=a,max=b)
1/(b-a)
- will be 0 if c<a>b
- will be 1/(b-a) if a<c<b
dunif() != P(X=k)</a>
Join
- joins are created using the foreign key
- need to select the data columns then say on what you will be joining them on
Super Key
- is like a superset from which other keys can be derived
- there can be null values
- column names can be combined to create keys
Candidate Key
- Minimal super key
- EX) [ID] would be a superkey and candidate key but [ID,Name] would not be because ID can be used alone and Name is not necessary
- can have null values
Primary Key
- A primary key must also be a candidate key (chosen from the candidate key list)
- A primary key can be comprised of multiple fields
- A primary key must also be a super key
- should rarely or never change
Foreign Key
- A foreign key can be null
- A foreign key can be compromised of multiple fields
- deals with 2 different tables
Join Formula
SELECT (column, column),
FROM (table_name SPACE
create_variable)
JOIN (other_table_name
SPACE create_variable)
ON (variable.column)=.
(othervariable.column)
Function to see the tables
dbListTables(insert database name)
Function to see the columns in table
dbListFields(database_name, ‘table_name’)
SQL
Structured Query Language
Aliasing
- when brackets [] are used in a query to change the apperance of a column name
SQL Statement Order
Select, From, Where, Group By, Having, Order By, Limit
Binomial Distribution: Variance Formula
= np(1-p)