Hi everyone,
I am currently struggling with something that I think is easy but i really couldn't figure out. I tried to explore all the possibilities in data manager but nothing worked.
I am using a dataset that contains a variable called refrencespouse (each person if has a spouse have a number). I am interested in the values of this variable and i want to use all of them in a egen command.
Meaning
egen example=anymatch(referencespouse), values(22 33 44 55 ...all observations)
I have tried to copy and paste all the observation but when I paste all this value are vertical and does not run in Stata. I have also tried to copy in Excel, transpose and then paste in Stata but all the observation are put together as a unique number.
I hope that my explanation is not too confusing, I can provide a screenshot if it is useful.
Thank everyone that has an idea,
Cereghetti Jean
Related Posts with use observation as a varlist
List Unique Data of One or More VariablesI would like to see a list of unique data for one or more variables. Can anyone please suggest how b…
Runby for each firm_id and yearHi, I am trying to run a regression for each firm_id (gvkey) and year and store the estimated coeff…
Collapse quarterly dataHello, I have this panel with a monthly date that I converted to a quarterly date. I want to keep a…
Loop over *dta files to export to csv filesDear Stata users I have 132 *dta files (X1.dta to X132.dta) in the folder which must be exported to…
Propensity Score Matching (PSM) + Difference-in-Difference (DID) regression with control variablesHi there, I have two-period balanced panel data (200 individuals in both periods), with which I hav…
Subscribe to:
Post Comments (Atom)
0 Response to use observation as a varlist
Post a Comment