Hi, I´m a rookie in using Stata and I am stuck at this point. I have an issue using the sum function. I have a data set of 1156 observations and I have encoded my data from string variables to numeric (long) variables. When opening the data editor I therefore now have the first variables in a kolonne with string values (colored yellow) and another new kolonne of generated numeric values (colored blue). As of earlier experience the data should be colored white (?).
The numeric variable I now have called "nbitprice" is encoded by using the following command: -encode bitprice, gen(nbitprice)- because they were recognized as strings
The problem is when I am running the -sum- command on nbitprice I am not getting the mean of the values in the observations which have a range from 3,000 to 19,000 in value. Instead I get the mean or median of the number of observations, meaning I get 577,1427 when having 1156 observations. What I want is the mean of the values for each observations over time. I hope I am explaining myself good enough.
When I list the observations there are values for each observation.
As reading of some earlier posts you would probably like som info:
. describe nbitprice
storage display value
variable name type format label variable label
--------------------------------------------------------------------------
nbitprice long %9.0g nbitprice
Bitprice
. count
1,156
. summarize nbitprice, detail
Bitprice
-------------------------------------------------------------
Percentiles Smallest
1% 12 1
5% 58 2
10% 116 3 Obs 1,156
25% 288.5 4 Sum of Wgt. 1,156
50% 577.5 Mean 577.1427
Largest Std. Dev. 332.9293
75% 865.5 1150
90% 1038 1151 Variance 110841.9
95% 1096 1152 Skewness -.0003597
99% 1142 1153 Kurtosis 1.79956
Can someone explain what I need to do to get the summarized results I need? I would like to get the mean of the actual value of the 1156 different observations, the standard deviation, min and max value.
Thank you for your help in advance.
Related Posts with summarizing in Stata
How to interpret predicted probabilities with continious variables in logistic regression?Hello everyone, I've got a question regarding how to interpret continious variables in logistic reg…
Calculating time between specific events in panel dataHello, I have panel data with 1 to 10 events per patid. The eventdate is the date of the stroke and…
Can I match on a baseline dataset from 2018 (treatment) and 2020 (control)?Dear Statalisters, I am currently writing my thesis on the topic of Multidimensional Empowerment. F…
extracting several string values from several different variablesHello, i am working with treatment data i have treatment1 treatment2 treatment3 treatmentn variables…
How to identify all cases with missing observationDear All How can I identify and list all cases with missing observation(denoted by .a) from a data …
Subscribe to:
Post Comments (Atom)
0 Response to summarizing in Stata
Post a Comment