Test 2 - Reproducible Research with R Flashcards
What is a “makefile”? Why do we use them?
A makefile is a form of batch file that executes multiple sub-files in order to create or build a project. Makefiles allow us to separate our program into parts, and be reassembled later.
What R command is used to tell R where to look for and place files?
The “setwd” command is used to tell R where to look for and place files.
What R command is used to tell R to run code in an R source code file?
The “source” command is used to tell R to run code in an R source code file.
The factor command converts non-factor variables into _____________ variables.
factor
If you are using GitHub or another service that uses secure URLs to host your analysis source code files you need to use the _____________ command in the devtools package.
source_url
Generally, the safest and most effective way to merge two data sets together is with the __________ command.
merge
A mediating variable is a variable that, while not intervening between the independent and dependent variables, influences the nature and strength of their relationship. True or False?
False. A mediating variable is one that intervenes between an independent and dependent variable, and removes the independent variable from being able to directly affect the dependent.
The __________________ command converts non-numeric variables into numeric variables.
as.numeric
What is an ordinal scale of measurement?
An ordinal scale of measurement is one that communicates greater than/less than relationships.
What does the melt command do? What package is it contained in?
The melt command, a part of reshape2, is used to reshape data from wide format to long format.
Commands in the foreign package have similar syntax to which command?
Commands in the foreign package have similar syntax to the read.table command.
A moderating variable is influenced by the independent variable, which in turn influences the
dependent variable. True or False?
False. A moderating variable is one that, instead of intervening between a dependent and independent variable, instead influences the strength of the relationship between them.
Which command would you use to search in each element of a vector?
To search in each element of a vector, you would use the “grep” command.
You can use the ___________________ command to read data into R that is located at a non-secure URL.
read.table
The __________________ command is used to read data files stored in a format created by
the Stata statistical package.
read.dta
What is the primary function of research methodology?
The primary function of research methodology is to guide and control the acquisition of data, and to aid in extracting meaning from the data once it’s been gathered.
What is face validity?
Face validity is the extent to which an instrument looks like it’s measuring a particular characteristic.
The purpose of measurement is to systematically limit the data in a way that makes it quantifiable. True/False
True. Measurement is designed to systematically limit data in a way that makes it quantifiable.
Measurement is applied by researchers only to insubstantial phenomena. True/False
False. Measurement is applied to all phenomena.
Systematic measurement assists researchers in obtaining objectivity in their researcher. True/False
True. Systematic measurement ensures that all data is gathered in the same way.
The _______________ function replaces all matches of a string.
gsub
With the melt command, what argument is used to specify id variables?
In the melt command, the id.vars argument is used to specify id variables.
With the melt command, what happens to the remaining columns not specified as id variables?
In the melt command, columns not specified as id variables are melted into two new variables, “variable” and “value.
Percentile ranks are often used to report performance on scholastic aptitude and achievement tests. True/False
True, percentile ranks are often used to report performance on scholastic aptitude and achievement tests.
What package is required to use the reshape command?
No packages are necessary to use the reshape command, it’s included in R naturally.
What are three techniques used to strengthen the internal validity of a study?
Three techniques used to strengthen the internal validity of a study are:
- Conduct a double-blind experiment
- Build in opportunities for triangulation
- Conduct the study in a controlled laboratory setting
What are three characteristics of a well-written research problem?
Three characteristics of a well-written research problem are:
- The problem statement identifies the important factors to be investigated in the study.
- The problem statement clearly delimits the objects of study.
- The problem statement explicitly identifies assumptions.
You can use the __________ command to see the number of rows and columns in a data frame object.
dim