Lab 2 Flashcards
What does the function setwd() do?
Sets your working directory
What command would you enter to set your working directory?
setwd()
What does the function read.delim do?
It reads a file that is set up in a matrix where rows represent cases and columns represent variables
What would you enter to read a file?
use the read.delim() function, and then use
How would you plot a relationship?
Use the plot() function, and enter both variables that you want to look at in the brackets, separated by a comma
How would you plot the relationship between two log transformed variables?
You would use the plot() function, and enter the two variables in the brackets, contained in brackets with log10 before them, separated by a comma
What would you add to suppress the plotting of the data points?
type=n
What would you expect as an output after entering instructions to plot a dataset, and entering type=n?
I would expect a blank plot with space for all data points contained in the specified datasets
What does != mean?
It means everything but this
What is -999 often?
It is often a placeholder for missing data when a dataset is built
What is the formula for average diversification rate?
log(N)/t where N is the extant species richness and t is time
What is an OLS?
An Ordinary least-squares is an analysis that fits a model of a relationship between one or more explanatory variables and a continuous variable that minimizes the sum of square errors, where an error is the difference between the actual and the predicted value of the outcome variable
What are sum of square errors?
A way to measure the difference between the estimated value based on a certain model and the actual value. A small sum of square error indicates that there is a tight fit between the model and the data
How would you fit an OLS regression to a plot?
use test.ols
What is the problem with using an OLS regression on phylogenetic data?
OLS regression assumes independence between the data points, but data from a phylogenetic tree are nested in a hierarchical structure with varying degrees of relatedness. It could look like there is a significant line between two variables, when really there are two unrelated groups for example.