2016년 1월 26일 화요일

아빠가 들려 주는 [통계] 데이터 전 처리 Preparation for analysis

엑셀로 데이터를 정리하는 요령, 
통계를 돌리기 전 
최소한의 준비라고 할 수 있는 잘못된 데이터를 찾고 
수정하고, 빠진 자료를 찾는 방법에 관한 이야기 입니다. 

사실 이것보다 훨씬 더 강력하고 편리한 기능이 
Web-R에서 곧 구현될 예정입니다. 
기대해 주세요. 

모든 연구자들이 좀더 창의적인 일에만 신경 쓸 수 있도록
단순한 일은 컴퓨터가 알아서 해 드릴 것입니다.



what every researcher should know

아빠가 들려 주는 [통계] long form ↔ wide form in Web-R.org





 long form 은 뭐고,  wide form 은 또 무엇이냐..

사실 동영상을 보시면 그냥 눈치 채실 겁니다.
(사실 엄격한 의미에서 꼭 맞지는 않지만, 대충 말하자면)
한 사람에게서 시간을 따라서 얻어진 자료를 한줄로 가로로 쓴 것을 wide form이라고 합니다.
paired t-test나 RM ANOVA 같은데 사용하죠.
그런데, 한 사람에 얻어진 자료를 세로로 쓴 것을 long form 이라고 합니다.
실제 모양은 동영상을 보시면 아실 것이고요,
이건 mixed model이나 GEE를 하기 위해서 필요합니다.

paired t-test나 RM ANOVA 에서는 하나라도 값이 없으면 그 사람 자료는 몽땅 없어집니다.
즉, 1,3,5개월 자료 중에 3개월 자료 하나만 없어도 그건 없는 것이랑 마찬가지 입니다.
mixed model이나 GEE는 이런 자료도 살려서 분석할 수가 있습니다.

병원에서의 자료는 보통 이런 시간에 따른 자료가 많죠.
longitudinal data라고 말하는 경우가 많습니다.

그것을 분석하기 위해서,
자료를 상호 호환할 필요가 있습니다.
 long form ↔ wide form
이렇게 말이죠.

이게 SPSS에서 됩니다. 그런데 너무 어려워서 제가 도무지 헷갈리더라고요.
저도 이전에 제가 써둔 매뉴얼을 한참 봐야 합니다.
뭐 GEE를 늘 하는 것도 아니고, 공부하려고 한번 실제 논문쓸려고 한번.. 이런 식일 텐데요..
이렇게 어려워서야....

그런데 Web-R.org 에서 이게 간단하게 되는 거 아닙니까?
아직 개선의 여지는 남아 있지만, 그래도 곧 되리라고 생각됩니다.
Web-R.org 화이팅

2016년 1월 16일 토요일

아빠가 들려 주는 [통계] Web-R 로 배워보는 카이제곱 검정

아빠가 들려 주는 [통계] Web-R 로 배워보는 카이제곱 검정



카이제곱 검정을 시행해 볼 수 있으면서
동시에 개인적으로 공부하기에 좋은 사이트,
그리고, 교수님이라면 강의에 활용하기도 좋아요. 

http://r-meta.com:3838/ttest/

다음에는 t-test에 대해서 배워 볼께요. 









2015년 12월 27일 일요일

[real statistics] All of chi-squre test


at first down load this file here for nothing,




zoom out the sheet.
(1) what is chi- square test and Pearson and Yates
(2) chi-square distribution
(3) Odds ratio, Risk Ratio, Risk Difference and their 95% confidence interval
(4) Phi and Cramer's V
(5) some charts fit to chi- square test. you can copy and paste Word or PowerPoint and modify them easily.


(6) only fill new number Yellow Cells!!!! Do not change other cells



And Now we follow the old man's thought


we make the final number.
the number is "chi-square"
Who made this number? Pearson made it.
The son of Pear? Not actually he is the father of Statistics.

The larger this number, the bigger the difference between expected and observed.
This is Pearson's thought and it is reasonable.


Now he made a nice conclusion.
the possibility that two table is same = p
p=0.005~ so two table is not same.

One scholar named Yates made a small change the number X2
So we call this new number 'Yates X2'
'Yates X2' is more accurate when the cell is small.
if the cell is large, Two X2 get closer.

  
yes we say the possibility be p=0.005

but "How much different"
there are many ways
(1) odds ratio
(2) risk ratio(=relative risk)
(3) risk difference
(4) Cramer V and phi

you can choose one in your paper and power point.
(1) odds ratio
     usually for cross-sectional study
     odds itself ratio between two observation.
(2) risk ratio(=relative risk)
     usually for cohort study
     risk usually include observation after time(period)
(3) risk difference
     usually for cohort study
     risk usually include observation after time(period)
     relatively no so popular but increasing
     especially for non-inferiority test

all three are written with it 95% confidence interval


(4) Cramer V and phi
     two values are same (when 2X2 table)
     not so common
     similar to correlation coefficient



Three chart are easy to understand.
you can copy and paste in your paper(MS word) and slide(powerpoint)
and modify them











2015년 12월 19일 토요일

구에 무작위로 화살 꽂기-generating random points on a sphere







이것이 왜 필요할까요?
어떤 분이 질문하셨던 문제입니다. 

if you want to have this excel file...

https://drive.google.com/file/d/0B0ETb2rCxDW2a2hsQWdYR21zRlU/view?usp=sharing

it's free for your study.
==============================
let me think a ball(unit sphere, r=1)
if you choose random latitudes and random longitudes
it will result in an uneven distribution, 
with the density increasing as we get closer to the poles.
So I want make a map.
this will be easy for even a student to understand.

if there is a ball. which r=1
, the circle is as long as 2π
if you choose a point on surface, which has θ in latitudes
the horizontal diameter will be cosθ

and the new circle which the the point will have a length 2πcosθ

if you spread the surface of the ball flat, while maintain the area.
you will get this picture,
this is a identical to cosθ curve actually.


Now choose several points randomly
Point A is in red which means out of the Ball
Point B is in blue which means on the surface of the Ball
we will take Point B 
and ignore Point A

let me thick, Point X

if Point X =(x, y)
you will get this picture.


Can you get latitudes  and random longitudes?
it is easy enough, a school test.
x:2πcosy=x’:2π
then
x’=x/cosy





shortly

YOU can get