1/29
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
sampling bias
a sampling method that consistently over or under represents certain data points (always rounding up or down)
measurment Error
Random inaccuracy in data collection
Sampling variation
natural differences b/w samples drawn from the same population
Rows in a data frame
cases/observations
Columns in a data frame
variables
Quotation marks in R
For text/character data
Symbol ! in R
NOT.
Symbol != in R
Not equal to.
Symbol == in R
Equal to.
- in R
Subtracts OR removes a variable in select().
how to Update part of a vector in R
By reassigning it (vec[2] <- 5)
tally() function
Counts frequencies.
select() function
selects multiple variables and makes a data table (select(df,y1,y2))
filter() function
Keeps only rows that meet a condition.
arrange() function
arrange rows by a variable.
str() or glimspe function
Shows structure of a data frame (lists variables).
factor() function
Coverts quant. to cat. variables
head() function
Shows first 6 rows.
tail() function
Shows last 6 rows.
sample() function
Draws a random sample.
Filter out missing data in R
filter(df, !is.na(variable)) or filter(df, is.na(variable)==False)
Tilde ~ in R
Means 'about.' Used in formulas like y ~ x = 'y depends on x.'
as.numeric
converts cat. to quant.
mutate()
adds or modifies varaibles (mutuate(df, variable = "y")
Quick overview of data frame variables
str(df) or glimpse(df).
Concerns when generalizing from data
sample is not random, representative, or lacks variation.
select()
produces a data table with a subset of chosen variables
recode()
recodes values by putting old ones in quoations and equaling to a new value (df, "0" = 2)
Random sampling
when every object has an equal chance of being chosen in a population
independent sampling
when selecting 1 object does not affect the chance of selecting another