Hi there,
I never really learned how to use loops, but feel like in this scenario it might be useful. I'd like to look at planting data (var: fecha_siembra) by farmer (var: nombre), but given that I have a ton of dates and farmers, I'd like to look at it by sales technician (var: tecnico).
I can look at the data by just tabulating by technician like so:
tab fecha_siembra nombre if tecnico=="Henry Figueroa"
But is there a way to use a loop to reduce time spent manually writing this code out for each of my 15 technicians?
I've provided a little sample dataset to hopefully help.
Thank you in advance for your guidance.
Taylor
* Example generated by -dataex-. To install: ssc install dataex
clear
input str10 fecha_siembra str30 nombre str20 tecnico
"2018-09-29" "Antonio Rodriguez" "Henry Figueroa"
"2018-11-22" "Nicolás Orozco" "Trinidad Recinos"
"2019-02-05" "OtroJoel Aguilar" "Ricardo Paredes"
"2018-10-15" "Anastasio López" "Juan Manuel de Leon"
"" "OtroManuel Gonzales" "Henry Figueroa"
"2019-01-14" "José Recinos" "Ricardo Paredes"
"" "Eliodoro X" "Henry Figueroa"
"2018-12-04" "Isaías Lapes" "Juan Manuel de Leon"
"2018-11-22" "José Leon" "Juan Manuel de Leon"
"" "Gloria Alvarado" "Juan Manuel de Leon"
end
Related Posts with Using Loops with tabulation
How to compute sum of observations for year and company (identified by id_name)Dear Statalist, How can I compute a new variable with the sum of observations per year and company:…
How can I create "dct" file to browse data of .dat format?Hi everyone, I might ask one of the stupidest questions but here is a problem that I've been strugg…
Multiple hypothesis testing commands in STATA (Wyoung and rwolf)Hi, I am correcting Multiple Hypothesis testing using wyoung and rwolf commands in STATA. Each comm…
Running regression on panel data using a single year of dataHi everyone, The data that I'm using is from a study by Nicholas Bloom, Mirko Draca and John Van Re…
Adjusted Variables (Anova)Hello Respected Seniors, Hope you all are doing great. I have one question i am not understanding t…
Subscribe to:
Post Comments (Atom)
0 Response to Using Loops with tabulation
Post a Comment