Hello,
I have never tried generating random data (number or string), and would like to learn how. I created a sample of faculty name. Next I want to create two variables. One variable would be "phd" for where they got their degree and I want Stata to randomly select from a pre-defined list (Penn, UCLA, MIT). The second variable would be "year" for when they got their degree, and I want Stata to randomly select an integer between 1970 and 2016. Please kindly share how you would approach it. I appreciate your suggestion.
input str10 name
"Mary"
"Lisa"
"Philip"
"Jack"
"Jill"
"Julia"
"Patrick"
"Scott"
"Jason"
"Donald"
"Mia"
end
Best,
Ji
I have never tried generating random data (number or string), and would like to learn how. I created a sample of faculty name. Next I want to create two variables. One variable would be "phd" for where they got their degree and I want Stata to randomly select from a pre-defined list (Penn, UCLA, MIT). The second variable would be "year" for when they got their degree, and I want Stata to randomly select an integer between 1970 and 2016. Please kindly share how you would approach it. I appreciate your suggestion.
input str10 name
"Mary"
"Lisa"
"Philip"
"Jack"
"Jill"
"Julia"
"Patrick"
"Scott"
"Jason"
"Donald"
"Mia"
end
Best,
Ji
Comment