User Tools

Site Tools


r:lecture

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
r:lecture [2015/11/05 07:57] hkimscilr:lecture [2015/11/05 14:19] (current) hkimscil
Line 1: Line 1:
 ====== Data ====== ====== Data ======
 R과 함께 인스톨된 public data들은 http://127.0.0.1:13732/library/datasets/html/00Index.html 에서 참조가 가능하다. R과 함께 인스톨된 public data들은 http://127.0.0.1:13732/library/datasets/html/00Index.html 에서 참조가 가능하다.
 +====== Descriptive Statistics ======
 +^           ^ R 명령어 
 +| 표본수    | length(v)  |
 +| 평균      | mean(v)  |
 +| 분산      | var(v) ((이 때 $df$값을 사용하므로 모집단의 혹은 그에 준하는 취급을 하는 분산을 구하려면 $\frac{n-1}{n}$ 분산값에 곱해준다. 즉, $\frac{SS}{n-1} * \frac{n-1}{n}$)) |
 +| 표준편차  | sd(v)  |
 +| 표준오차  | sd(v)/sqrt(length(v))  |
 +| 변동계수  | ...  |
  
-데이터보기: ''trees'' \\ +표준오차 값은 데이터의 상황에 따라 다르게 구하므로 함수를 만들어서 사용하거나, 해당상황에 맞는 공식을 용하여 구하는 것이 좋다 ((함수만드는 방법 참조)).
-터셋 설명: ''?trees'' (http://127.0.0.1:13732/library/datasets/html/trees.html) \\ +
-요약: ''summary(trees)'' \\ +
-\\+
  
-<code - trees.dat>   Girth Height Volume +boxplot(Volume) 
-1    8.3     70   10.3 +boxplot(Volume, col="green")
-2    8.6     65   10.3 +
-3    8.8     63   10.2 +
-4   10.5     72   16.4 +
-5   10.7     81   18.8 +
-6   10.8     83   19.7 +
-7   11.0     66   15.6 +
-8   11.0     75   18.2 +
-9   11.1     80   22.6 +
-10  11.2     75   19.9 +
-11  11.3     79   24.2 +
-12  11.4     76   21.0 +
-13  11.4     76   21.4 +
-14  11.7     69   21.3 +
-15  12.0     75   19.1 +
-16  12.9     74   22.2 +
-17  12.9     85   33.8 +
-18  13.3     86   27.4 +
-19  13.7     71   25.7 +
-20  13.8     64   24.9 +
-21  14.0     78   34.5 +
-22  14.2     80   31.7 +
-23  14.5     74   36.3 +
-24  16.0     72   38.3 +
-25  16.3     77   42.6 +
-26  17.3     81   55.4 +
-27  17.5     82   55.7 +
-28  17.9     80   58.3 +
-29  18.0     80   51.5 +
-30  18.0     80   51.0 +
-31  20.6     87   77.0 +
-</code>+
  
-chickwts +hist(Volume, probability=T) 
-''chickwts'' +lines(density(Volume), col="blue") 
-''?chickwts'' + 
-''summary(chickwts)''+rnorm(n=31, mean=0, sd=1) 
 +rnorm(31) 
 + 
 +qqnorm(x) 
 +qqline(x) 
 + 
 +====== 함수만들기 ====== 
 +se = function(x) sd(x)/sqrt(length(x)) 
 + 
 +====== 시뮬레이션 ====== 
 +set.seed(1234) 
 +height = rnorm(n=100000, mean=175, sd=5) 
 +mean(height) 
 + 
 + 
 +M=NULL 
 +V=NULL 
 +for (i in 1:10000) {  
 +x=sample(height, size=100)  
 +M[i]=mean(x)  
 +V[i]=var(x)  
 +
 + 
 +====== t-test ====== 
 +x = c{15.5, 11.21, 12.67, 8.877, 12.15, 9.88, 2.06, 14.5, 0, 4.97}
  
r/lecture.1446679641.txt.gz · Last modified: 2015/11/05 07:57 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki