User Tools

Site Tools


b:head_first_statistics:visualization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:head_first_statistics:visualization [2022/09/14 11:10] hkimscilb:head_first_statistics:visualization [2024/09/04 08:49] (current) – [Scatter plot] hkimscil
Line 79: Line 79:
 | 999  | 2  | | 999  | 2  |
  
 +{{:b:head_first_statistics:pasted:20240904-082648.png}}
  
 in R . . . .  in R . . . . 
Line 90: Line 90:
 hist(dat, breaks=5) hist(dat, breaks=5)
 </code> </code>
 +{{:b:head_first_statistics:pasted:20240904-082258.png}}
 ====== Scatter plot ====== ====== Scatter plot ======
 <code> <code>
Line 138: Line 138:
    pch=19)</code>    pch=19)</code>
  
-{{:c:ps1-1:2019:pasted:20190909-075028.png}}+{{:b:head_first_statistics:pasted:20240904-083016.png}}
  
 explanatory (설명) variable at x axis explanatory (설명) variable at x axis
Line 146: Line 146:
  
 Drawing a line among the data. Drawing a line among the data.
 +
 <code># Add fit lines <code># Add fit lines
 abline(lm(mpg~wt), col="red") # regression line (y~x) abline(lm(mpg~wt), col="red") # regression line (y~x)
-lines(lowess(wt,mpg), col="blue") # lowess line (x,y)</code> +</code> 
-{{:c:ps1-1:2019:pasted:20190909-075639.png}}+{{:b:head_first_statistics:pasted:20240904-083157.png}} 
 + 
 +Outlier에 대한 주의 
 +[{{:pearson-6.png? |}}] 
 +<WRAP clear />
  
  
Line 162: Line 167:
 {{:c:ps1-1:2019:pasted:20190909-080032.png}} {{:c:ps1-1:2019:pasted:20190909-080032.png}}
  
-Line can be:  
- 
-**__관계의 방향 (direction)__** 
-^  관계의 방향  ^^  
-| {{:r.positive.png}}  | {{:r.negative.png}}  | 
- 
- 
-**__관계의 모양 (shape)__** 
-^  관계의 모양  ^^  
-| {{:r.positive.png}}  | {{:r.curvepositive.png}}  | 
- 
-**__관계의 정도 (힘)__** 
-^  관계의 정도 (힘)  ^^  
-| [{{:r.StrengthA.png|Figure_4-1}}]  | [{{:r.StrengthB.png|Figure 4-2}}]  | 
-| [{{:r.StrengthC.png|Figure_4-3}}]  | [{{:r.StrengthD.png|Figure 4-4}}]  | 
-<WRAP clear /> 
-Pearson's r 의 의미 
-__Relations, not cause-effect__ 
-[{{:r_eg.15.6.png?250 |Figure 6. Correlation And Causation}}] 상관관계 계수는 단순히 두 변인 (x, y) 간의 관계가 있다는 것을 알려줄 뿐, 왜 그 관계가 있는지는 설명하지 않는다. 바꿔 말하면, 충분한 r 값을 구했다고 해서 이 값이 두 변인 간의 '''원인'''과 '''결과'''의 관계를 말한다고 이야기 하면 __안된다__. 예를 들면 아이스크림의 판매량과 성범죄가 서로 상관관계에 있다고 해서, 전자가 후자의 원인이라고 단정할 수 있는 근거는 없다. 이는 연구자의 논리적인 판단 혹은 이론적인 판단에 따른다.  
 <WRAP clear /> <WRAP clear />
  
-__Interpretation with limited range__ +====== Presentation ====== 
-[{{:r_eg.15.71.png?250 |Figure_7._Correlation_And_Range}}]  +For a very good example, see
-[{{:r_eg.15.7b1.png?250 |Figure_7._Correlation_And_Range}}]  +
-데이터의 [[Range]]에 대한 판단에 신중해야 한다. 왜냐 하면데이터의 어느 곳을 자르느냐에 따라서 r 값이 심하게 변하기 때문이다.  +
-<WRAP clear /> +
-__Outliers__ +
-[{{:r_eg.15.8a.png?250 |Figure_7._Correlation_And_Extreme_Data}}]  +
-[{{:r_eg.15.8b.png?250 |Figure_7._Correlation_And_Extreme_Data}}]  +
-위의 설명과 관련하여, 만약에 아주 심한 Outlier가 존재한다면 두 변인 간의 상관관계에 심한 영향을 준다. +
-[{{:pearson-6.png?300 |}}] +
- +
-make it sure that there is __no data entry error__. +
-{{:r.crime.scatterplot.for.single.by.state.jpg}} +
- +
- +
-<WRAP clear /> +
- +
-see +
 https://www.gapminder.org/answers/how-does-income-relate-to-life-expectancy/ https://www.gapminder.org/answers/how-does-income-relate-to-life-expectancy/
   * Life expectancy data: {{:life.exp.csv}}   * Life expectancy data: {{:life.exp.csv}}
  
-<code+<WRAP clear/
-le <- as.data.frame(read.csv("http://commres.net/wiki/_media/life.exp.csv", header=T)) +====== Histogram skewedness ======
-colnames(le)[1] <- "c.code" # not really necessary. But, sometimes imported first characters are broken. +
-lea <- le$X2017 +
-leb <- lea[complete.cases(lea)] +
-hist(leb, color="grey"+
-</code>+
  
-[{{:c:ps1-1:2019:pasted:20190909-110252.png|Life expectancy in 2017}}] 
- 
-[{{:c:ps1-1:2019:pasted:20190909-104759.png|Distribution of temperature}}] 
  
 [{{:c:ps1-1:2019:pasted:20190909-111117.png|skewness}}] [{{:c:ps1-1:2019:pasted:20190909-111117.png|skewness}}]
 +<WRAP clear/>.
 [{{:c:ps1-1:2019:pasted:20190909-111001.png|modality}}] [{{:c:ps1-1:2019:pasted:20190909-111001.png|modality}}]
 +<WRAP clear/>.
 +====== box plot ======
  
-box plot 
 <code> <code>
 # Boxplot of MPG by Car Cylinders # Boxplot of MPG by Car Cylinders
b/head_first_statistics/visualization.1663121403.txt.gz · Last modified: 2022/09/14 11:10 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki