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
Finite mixture model vs. Latent class modelHi scholars, Would you please explain the difference between Finite mixture model and Latent class …
Hosmer–Lemeshow test for large data setsHosmer–Lemeshow test for large data sets gives low p value despite perfectly fitting model. Increasi…
Generating unique ID variable from numeric and categorical variablesHello all, I am new to forum and I have a question about generating new IDs. Thanks for your patienc…
Interpretation of the margins plot with categorical variablesHello every one, Iam having trouble interpreting a margins plot and the margins output as well whiil…
reshape commandhi, I need to reshape a huge data set wide to long (2557 binary variables and 1.6 million observatio…
Subscribe to:
Post Comments (Atom)
0 Response to summarizing in Stata
Post a Comment