Hi everyone,
I have three variables of my interest for my microdata: consumer IDs, month, card type. I would like to calculate some summary statistics. In particular, first I want to find number of observations per month. This is the code to realize this:
gen count=1
collapse (sum) count, by(txn_yrmon)
Second, I want to find the number of consumers per month. So basically I want to find the number of unique consumer IDs in each month. Third, I want to find the number of consumers per month by card type.
I'm still learning how to approach this process. Could you please help me on last two questions? Thanks in advance!
Related Posts with Unique IDs by month
Use past quarter average of data to regress with next quarter data.Hello all, I am a newbie to STATA and struggling with a peculiar problem. Hoping for some insight f…
Way to identify first successful loop iteration?Hi Stata, I have a loop: forv x = 1/100{ cap{ [stata_commands] [if first successful iteration, exe…
Confusion about how to keep one row of data for each student with the most number of classes taken in a programI am using Stata 15.1 for Windows. I would like to keep a certain student in the program that he co…
problems with moving average - panel dataHi everyone, I am using Italian administrative longitudinal data for 10 years. Since I would like to…
-mimrgns- and -marginsplot-The help file for mimrgns states that while "[i]n principle, marginsplot works after mimrgns […], th…
Subscribe to:
Post Comments (Atom)
0 Response to Unique IDs by month
Post a Comment