If year=1,2,3,4; and prov=1,2,3,4,5,6,7. So how to calculate i*j, thanks a lot!
I run this,but it is wrong.
forvalues i=1/4 {
forvalues j=1/7 {
gen yearprov `i' `j'=year`i'*prov`j'
}
}
Related Posts with How to generate i*j by forvalues?
How to locate the observations with string IDs sharing some substrings?For example, I want to change the values of observations for the variable "execution_location" inclu…
Panel data survival modelHello everyone! I have a country code year panel data. I want to create a duration variable (dur_reg…
Very easy question but troubleing me...Hi guys, I am a new STATA user and I want to ask a very amateur question about date and formatting. …
Need Help on STATA loopHello, Everyone, I want to assign individuals (id) into groups of five (group) in the following pat…
difference of timeDear All, I was asked this question (here). The data set is Code: * Example generated by -dataex-. …
Subscribe to:
Post Comments (Atom)
0 Response to How to generate i*j by forvalues?
Post a Comment