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
Which family and link for GLM?Hello! I am trying to find the right model that matches the distribution of my data. I use cross-se…
if time dummies are dropped in system GMM; How we can interpret? - xtabond2Hello, I need your help. I hope you are staying safe. I have an unbalanced panel dataset. It includ…
Clustering standard errors at industry levelDear Statalist members, Currently my data size is about 12,000 observations. The topic of my thesis…
Extracting first five and last three parts from string variable.Dear Stata users, I hope you are staying safe. I have data set with code and name like this. Code…
How to create an iterative procedure to check variable by variable whether a given observation satisfies some criteria - string variablesDear all, I am working with string data and I would like to retrieve the most important word from a…
Subscribe to:
Post Comments (Atom)
0 Response to summarizing in Stata
Post a Comment