summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.5.2/lib/rouge/demos/stata
blob: 3d2430dca1ed034fee59a41d7cd7564fdab47265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
* Run a series of linear regressions
sysuse auto, clear
foreach v of varlist mpg weight-turn {
	regress price `v', robust
}

regress price i.foreign
local num_obs = e(N)
global myglobal = 4

* Generate and manipulate variables
generate newvar1 = "string"
generate newvar2 = 34 - `num_obs'
replace newvar2 = $myglobal