Worksheets02_Stats
Total questions: 5
Worksheet time: 4mins
To investigate the relationship between two continuous variables (x1 and x2) in Stata, you would use
tab x1 x2
sum x1 x2
scatter x1 x2
hist x1 x2
To investigate the relationship between two categorical variables (x1 and x2) in Stata, you would use
tab x1 x2
sum x1 x2
scatter x1 x2
hist x1 x2
How can you display summary statistics of all the variables in the dataset in Stata?
sum
summar
summarize
All of the above
There is a variable y in you dataset and you want to create a new variable x. Choose the line of code that would result in an error:
gen x = 2
gen x = 2 if y < 2
gen x = 2 if y = 2
gen x = 2 if y == 2
How can you combine if conditions in Stata?
With & as "and" and | as "or"
With & as "or" and | as "and"
It is impossible to combine conditions, there can be only one per line.
With () as "or" and [] as "and".
