Descriptive statistics
Simple statistics
matlab
Excel
SPSS
Correlation coefficient
Spearman correlation coefficient
Mathematical Modeling-Spearman Correlation Coefficient
Pearson correlation coefficient
Mathematical modeling-Pearson correlation coefficient
Stata makes probability density estimation graph and saves the picture
// 做x的概率密度估计图
kdensity x
//保存图片
graph export a.png ,replace
Stata's descriptive statistics on data
Quantitative data
summarize 变量1 变量2 ... 变量n
- If you put it in the paper, you need to put it in Excel first to become a three-line table, and then put the three-line table in the paper
summarize 变量 ,d
- Percentiles
said that the data corresponding to the variables are sorted from small to large, and then output in 1%, 5%,..., 99% 1\%,5\%, ..., 99\%1%,5%,...,9 9 % corresponds to the value of the variable — look at itIs the data distribution uniform
Qualitative data
// 得到出现的次数(Freq)
tabulate 变量
- This function only analyzes one variable at a time
tab 变量 ,gen(A)
- Generate dummy variables A 1...A n A1...AnA1...An
- For example, in the figure, there are two recipes, there are two dummy variables A 1, A 2 A1, A2A 1 ,
When A 2 is the first formula,A 1 = = 1; A 2 = = 0 A1 == 1; A2==0A 1==1;A 2==0
When it is the second formula,A 1 = = 0; A 2 = = 1 A1 == 0; A2==1A 1==0;A 2==1
Excel draws frequency fan chart of variables
- Insert -> PivotTable
- Select the desired field
You can choose how the value is displayed (number or percentage) - Draw a fan chart
analysis -> data perspective chart
-
Add numbers to the picture
-
In order to make the drawn pictures have a sense of beauty,
you can sort them before you start drawing -> Sort
Color can be changed: Page Layout -> Color