1/42
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is statistics the study of?
Variation
___ and ___ provide many tools for decomposing the signals, or important information, in medical, genetic, and ecological data.
Statistics, Probability
Why do we want to study variation?
We want to know why people, objects, specimens, etc. vary.
If we can understand variation, we can use this knowledge to help us predict future outcomes.
What is the equation used for statistical modeling?
Model + Error = Data
What are the 3 main ways statistical modeling will help us?
1.) To help us understand the Data Generating Process (the underlying process that creates variation in the data).
2.) To help us predict what may happen in the future.
3.) To help us improve functioning of complex systems.
What is R?
R is a programming language.
What does programming mean?
Programming means to write executable commands that can instruct the computer to perform various tasks.
What does executable mean?
Executable means that the code can be understood and run by a computer.
What is a variable? (ex: x = 3)
A symbolic name that stores some value, which may or may not be known when the variable is defined/created.
What is a function?
An instruction that takes arguments and performs some specific task.
What does a function always have?
Functions will always have a (…).
What are the two assignment operators?
= and <-
What are keywords?
These are words reserved for special purposes and thus you cannot name your variables using keywords.
What are some keywords in R?
if, else, while, for, in, next, break, function, TRUE, FALSE, NULL, Inf, NaN, NA.
What are the different data types in R?
Numeric: x = 1
Integer: x = 1L
Complex: x = 1 + 0i
Character: x = “1”, y = “one”
Logical: x = TRUE, y = FALSE
What are formed when elements of the same or different data types are combined?
data structures
What is a vector?
a homogeneous 1-D (linear) array of elements.
What is a matrix?
a homogeneous 2-D (rectangular) array of elements.
What is a list?
a heterogeneous 1-D array
What is a data frame?
a heterogeneous 2-D array
What can a vector do?
Vectors can store one or many numbers or characters.
What does the c() function create?
a vector
The items inside the vector must be of the ___ data type!
same
Characters/words must have ___ or ___ around the text?
“ “, ‘ ‘
Data frames allow us to do what?
Data frames allow us to store different types of data in the same R object.
Each row is an __.
Each column is a variable __.
observation
variable
head() will show you the ___ _ rows of data from a data frame.
tail()will show you the ___ _ rows of data from a data frame.
first 6
last 6
glimpse() vs str()
glimpse() uses rows and columns
str() uses observations and variables
The names of the variables, data types of the variables, and entries for the variables are the same for both.
What is the code format for extracting out a variable from a data frame?
data_frame_name$variable_name
What is the code format to extract out a specified observation, using the row number?
data_frame_name[row_number , ]
What is the code format to extract out a specified variable, using the column number?
data_frame_name[ , column_number]
What conditional statement format can we use to extract out information?
Data_frame_name[Data_frame_name$variable_name == “entry” , ]
How can we combine two conditional statements?
We use & to mean “and”
We use | to mean “or”
What does tally() do?
Tally() creates a Frequency Table for a Particular Variable
What are the general formats for tally() ?
tally(Data_frame_name$variable_name)
tally(~ variable_name, data = Data_frame_name)
What is the general format for the function for viewing data from high to low?
arrange(Data_frame_name, desc(variable_name))
What is the general format for the function for viewing data from low to high?
arrange(Data_frame_name, variable_name)
Quantitative vs. Categorical Variables in R
Quantitative:
- Take numerical values
- Mathematical operations on these variables is meaningful
Categorical:
- Do not represent quantities
- Represents categories
- Mathematical operations on these is useless.
Quantitative Data in R is either ___, ___, or ___
num is numeric
int is integer
dbl is double (just means the number has decimals)
What does factor() do and what is its general format?
factor() checks what type of categories a categorical variable contains and its general format is factor(Data_frame_name$variable_name)
What is the different between select() and filter() ?
The select() function will select specific columns (variables) in a data frame, whiles the filter() function will rows/cases where the conditions indicated are true.
Missing data is usually labeled with an ___ or ___.
NA or NaN
What are some questions that should be addressed when looking at missing data?
Why is it missing?
Is it due to error?
Is it information we can obtain from another data frame?
Should we not include it in an analysis? And why?
Can we fill in the missing data somehow?