Hi,
My variables' names are something like var11, var11_oth, var12, var12_oth, var13, var13_oth.etc... up to 12. All of variables ending with "_oth" are in string format; and the others are numeric values.
I want to create a new variable which is the sum of all numeric values only. My code was like:
egen=rowtotal (var*)
But it will include the string variables also.
Is there any other way of refering to numeric variables without typing one by one?
Thank you so much,
Lanna
Related Posts with Refer to multiple variables in Stata
Count dates within previous 31 day range for each date using forvaluesDear Stata colleagues, I created a loop in order to count the number of dates following 3 condition…
Calculating difference in differences, percentages and treatment effectsHi everyone, I'm working on a project for my economic development course and am having difficulty d…
Confidence Intervals / Errr plots with binscatterI am trying to include confidence intervals / errors bars in a plot for two variables using -binscat…
Convert clock data type to dailyHi Statalisters, I have had issues with converting a date variable which was imported from database…
Finding the number of firms for which a given worker has worked - Matched employer-employee datasetDear all, I am working with a matched employer-employee dataset from Brazil in which each observati…
Subscribe to:
Post Comments (Atom)
0 Response to Refer to multiple variables in Stata
Post a Comment