-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhw5.do
41 lines (41 loc) · 1.49 KB
/
hw5.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
qui {
if 0 { //Background
1. Intermediate Stata
2. Practice session of week 1-4 content
3. Let's create an online module
}
if 1 { //Log, Settings, Macros, Workdirectory, Data
cls
clear
capture log close
log using wk5.log, replace
local output "/users/d/desktop"
global url "https://raw.githubusercontent.com/hyomin295/HW-1/main/hw1log_updated.do" //you all have your own URLs, this is one of your peers just for demo purposes
global table1_fena "https://raw.githubusercontent.com/jhustata/basic/main/table1_fena.ado"
capture confirm file "`output'"
if _rc == 0 {
cd "`output'"
}
else {
noi di "Provide the filepath you wish to direct your output to" _request(output)
cd "$output"
}
do "$url" //data simulation
}
if 2 { //Install table1_fena.ado, Output a Table 1
local num_lines 7
capture file open myfile using "$table1_fena", read text
forvalues i = 1/`num_lines' {
file read myfile line
cls
noi di "`line'"
}
file close myfile
noi di "Use the above syntax to create a Table 1 for your simulated dataset" _request(syntax)
noi di "Type ds to review the variables available to you in this dataset" _request(syntax)
noi di "When finished, type the commands pwd and ls to see your outputfiles" _request(syntax)
noi di "Remember: your syntax should always be preceeded with a command (e.g., table1_fena)" _request(syntax)
qui do "$table1_fena"
}
log close
}