DSCI 100 FINAL STUDY GUIDE
Descriptive Question - Answers :question that asks about summarized characteristics of
dataset w/o interpretation
Exploratory Question - Answers :question that asks if there are patterns, trends, or
relationships within single dataset (often used to propose hypotheses)
Predictive Question - Answers :asks about predicting measurements/labels for
individuals; focus on what predicts outcome; not cause of outcome
Inferential Question - Answers :question that looks for patterns, trends, relationships in
single dataset & asks for quantification of how applicable these findings are to wider
population
Casual Question - Answers :question that asks about whether changing one factor will
lead to change in another
Mechanistic Questions - Answers :question about underlying mechanisms of observed
patterns, trends, relationships
Summarization (analysis tool) - Answers :used to answer descriptive (sometimes
exploratory) questions, computing & reporting aggregated values pertaining to dataset
Visualization (analysis tool) - Answers :plotting data graphically, used to answer
descriptive/exploratory questions; important to all though
Classification (analysis tool) - Answers :predicting class/category for new observation,
used to answer predictive questions
Regression (analysis tool) - Answers :predicting quantitative value for new observation,
used for predictive questions
Clustering (analysis tool) - Answers :finding previously unknown/unlabeled subgroups in
dataset, used to answer exploratory questions
Estimation (analysis tool) - Answers :taking measurements for small # of items from
large group & making guess for average/proportion for large group, for inferential
questions
tabular data (most common) - Answers :almost like excel spreadsheet, rectangular
shaped
Observations/Variables - Answers :refered to rows & columns respectively
,comma separated values (csv) - Answers :A data frame format in which a comma is
placed between each data value in the file
read_csv - Answers :used to read in comma-separated files, expects file to have column
names & no row names
how to read in data with read_csv - Answers :read_csv("locationoffile/filename")
naming things in R - Answers :useful so that we can refer to it (the output of a function)
later on; use <- (where name is on the left, function on the right); use specific names, no
need for quotes, but can use letters, #'s, _/.
how to name things in R - Answers :file_name <- read_...("locationoffile/filename")
filter function - Answers :filter obtains subsets of rows w/ desired values from a
dataframe (so specific values wanted)
how to use filter function - Answers :filter(dataframe, nameofcolumntofilter ==
"specifcvaluewanted"); lots of options that can be used instead of ==, like >,<
select function - Answers :select extracts wanted columns from data frame
how to use select function - Answers :select(dataframe, column1, column2)
arrange function - Answers :allows us to order rows of dataframe by values of particular
column
how to use arrange - Answers :arrange(dataframe, by = desc/asce(columntosort))
slice function - Answers :selects rows according to their row number
how to use slice - Answers :slice(dataframe, 1:10); takes rows 1 to 10
mutate function - Answers :mutate allows us to add/modify our columns
how to use mutate - Answers :mutate(dataframe, newcolumnname =
modifiedversionofoldcolumn) ex. 100* column / column
ggplot function - Answers :creates a plot to visualize data
how to use ggplot - Answers :ggplot(dataframe, aes(x = column, y = column) +
geom_...() + xlab("name") + ylab("name") + ggtitle("name") + theme(text =
element_text(size = #))
how to use ?function - Answers :? pulls up documentation for most functions; tells us
what function does
, absolute file path - Answers :indicates where a file is with respect to computer's
filesystem base (root folder) no matter where you are working; the file's entire path;
always starts with /
how to use absolute file path - Answers :name <- read_csv("/home/dsci-
100/project/data/nameoffile")
relative file path - Answers :A file path that starts from the user's current directory
how to use relative file path - Answers :name <- read_csv("data/nameoffile")
relative path or absolute path? - Answers :relative path is preferred, ensures code can
be run on different devices (so its portable), shorter & easier to type
delimiter - Answers :A character that separates data entries from one another
skip function - Answers :sometimes in dataframes there is excess information at the
beginning before data, use skip function to skip these rows of unnecessary data
how to use skip - Answers :read_csv("...", skip = #)
read_tsv() (tab separated values) - Answers :reads in dataframes where tabs are the
delimiter
how to use read_tsv - Answers :read_tsv(".../....tsv)
read_delim() - Answers :reads in files with any delimiter, just have to specify the
delimiter
how to use read_delim - Answers :read_delim("data/can_lang_no_names.tsv", delim =
"\t", col_names = FALSE) (only if there are no column names)
if data has no column names - Answers :R will automatically assign names, just have to
rename them using rename(dataframe, name1 = column,
name2 = column2,
etc.)
reading in URL's - Answers :do url <- "https://raw.githubusercontent.com/UBC-
DSCI/data/main/can_lang.csv"
then,
read_...(url)
how to download file prior to working on it in R - Answers :use download.file(url, "path")
then read in data
Descriptive Question - Answers :question that asks about summarized characteristics of
dataset w/o interpretation
Exploratory Question - Answers :question that asks if there are patterns, trends, or
relationships within single dataset (often used to propose hypotheses)
Predictive Question - Answers :asks about predicting measurements/labels for
individuals; focus on what predicts outcome; not cause of outcome
Inferential Question - Answers :question that looks for patterns, trends, relationships in
single dataset & asks for quantification of how applicable these findings are to wider
population
Casual Question - Answers :question that asks about whether changing one factor will
lead to change in another
Mechanistic Questions - Answers :question about underlying mechanisms of observed
patterns, trends, relationships
Summarization (analysis tool) - Answers :used to answer descriptive (sometimes
exploratory) questions, computing & reporting aggregated values pertaining to dataset
Visualization (analysis tool) - Answers :plotting data graphically, used to answer
descriptive/exploratory questions; important to all though
Classification (analysis tool) - Answers :predicting class/category for new observation,
used to answer predictive questions
Regression (analysis tool) - Answers :predicting quantitative value for new observation,
used for predictive questions
Clustering (analysis tool) - Answers :finding previously unknown/unlabeled subgroups in
dataset, used to answer exploratory questions
Estimation (analysis tool) - Answers :taking measurements for small # of items from
large group & making guess for average/proportion for large group, for inferential
questions
tabular data (most common) - Answers :almost like excel spreadsheet, rectangular
shaped
Observations/Variables - Answers :refered to rows & columns respectively
,comma separated values (csv) - Answers :A data frame format in which a comma is
placed between each data value in the file
read_csv - Answers :used to read in comma-separated files, expects file to have column
names & no row names
how to read in data with read_csv - Answers :read_csv("locationoffile/filename")
naming things in R - Answers :useful so that we can refer to it (the output of a function)
later on; use <- (where name is on the left, function on the right); use specific names, no
need for quotes, but can use letters, #'s, _/.
how to name things in R - Answers :file_name <- read_...("locationoffile/filename")
filter function - Answers :filter obtains subsets of rows w/ desired values from a
dataframe (so specific values wanted)
how to use filter function - Answers :filter(dataframe, nameofcolumntofilter ==
"specifcvaluewanted"); lots of options that can be used instead of ==, like >,<
select function - Answers :select extracts wanted columns from data frame
how to use select function - Answers :select(dataframe, column1, column2)
arrange function - Answers :allows us to order rows of dataframe by values of particular
column
how to use arrange - Answers :arrange(dataframe, by = desc/asce(columntosort))
slice function - Answers :selects rows according to their row number
how to use slice - Answers :slice(dataframe, 1:10); takes rows 1 to 10
mutate function - Answers :mutate allows us to add/modify our columns
how to use mutate - Answers :mutate(dataframe, newcolumnname =
modifiedversionofoldcolumn) ex. 100* column / column
ggplot function - Answers :creates a plot to visualize data
how to use ggplot - Answers :ggplot(dataframe, aes(x = column, y = column) +
geom_...() + xlab("name") + ylab("name") + ggtitle("name") + theme(text =
element_text(size = #))
how to use ?function - Answers :? pulls up documentation for most functions; tells us
what function does
, absolute file path - Answers :indicates where a file is with respect to computer's
filesystem base (root folder) no matter where you are working; the file's entire path;
always starts with /
how to use absolute file path - Answers :name <- read_csv("/home/dsci-
100/project/data/nameoffile")
relative file path - Answers :A file path that starts from the user's current directory
how to use relative file path - Answers :name <- read_csv("data/nameoffile")
relative path or absolute path? - Answers :relative path is preferred, ensures code can
be run on different devices (so its portable), shorter & easier to type
delimiter - Answers :A character that separates data entries from one another
skip function - Answers :sometimes in dataframes there is excess information at the
beginning before data, use skip function to skip these rows of unnecessary data
how to use skip - Answers :read_csv("...", skip = #)
read_tsv() (tab separated values) - Answers :reads in dataframes where tabs are the
delimiter
how to use read_tsv - Answers :read_tsv(".../....tsv)
read_delim() - Answers :reads in files with any delimiter, just have to specify the
delimiter
how to use read_delim - Answers :read_delim("data/can_lang_no_names.tsv", delim =
"\t", col_names = FALSE) (only if there are no column names)
if data has no column names - Answers :R will automatically assign names, just have to
rename them using rename(dataframe, name1 = column,
name2 = column2,
etc.)
reading in URL's - Answers :do url <- "https://raw.githubusercontent.com/UBC-
DSCI/data/main/can_lang.csv"
then,
read_...(url)
how to download file prior to working on it in R - Answers :use download.file(url, "path")
then read in data