본문 바로가기
Biostatistics

무슨 모형을 쓸 것인가?

by 올뺴미 2023. 6. 9.

선형혼합모형(LMM) 
 
전통적인 다변량 분석방법은 동일한 반복횟수와 동일한 관측시점의 가정이 필요하다.
시간가변공변량 적용에 한계를 가지고, 결측자료 효과 반영 방법이 많지 않다.
관측개체 간 반복 횟수가 다르고 관측 시점이 다를 경우 선형혼합모형을 사용할 수 있다
- 평균반응에 대한 모형
- 공분산구조의 설정과 추정
 
가문비나무... 오존이 식물의 성장에 미치는 영향 조사?
오존 노출 여부 - 오존 노출(54) 오존비노출 (25)
동일관측시점에서 같은관측횟수
오존 비노출그룹이 기저그룹으로 배치
각 관측시간을 이산형변수로 간주
단조 증가하지 않는 자료에 적합
152일부터 시작 - 152가 baseline
성장패턴 - 시간이 갈수록 평균 성장 
오존 처리를 받은 그룹이 오존처리없는그룹보다 성장이 느림
 
 
gee
gee를 시간가변공변량 time-varying covariate도 사용이 가능하다.
t
1) 이항경시적자료분석
주변모형: 비타민섭취와 호흡기 관련 유병률의 연관성을 연구하는 공공 보건상의 목적이므로 주변모형을 사용
흡연자 / 비흡연자
sleep disturbance 발생 여부 ? 
인도네시아 어린이 비타민 a결핍/ 미결핍
결핍여부를 고려한다음에 6개 시점에서 조사를 해가지고 결핍여부와 호흡기 질병발생 확률 연관관계를 조사하는거고 그에 대한 답은
1) 시간이 경과함에 따라 질환 발생 가능성은 증가하는가?
2) 비타민 A결핍 여부와 호흡기 질병 발생 확률과 연관관계가 있는가?
3) 비타민 A 결핍 여부와 호흡기 질병 발생 확률과의 연관관계가 시간에 따라 어떻게 변화하는가?
여기서는 binary자료인듯
 
1) 시간이 경과함에 따라 sleep disturbance(코골이 횟수/ 자다깬횟수)는 증가하는가? - 당연히 안 증가하겠지
2) 스트레스와 코골이횟수 / 자다깬횟수간의 연관관계가 있는가?
스트레스와 코골이횟수 / 자다깬횟수간의 연관관계가 있는가?
공변량에는 시간, 나이, 성별, 신장, 체중
시간고정공변량에는 흡연?
90-91pg 인도네상
 
HIV 자료에는 시간가변공변량.... 나이를 ㅔㅈ외하고
 
2
 
명목형경시적자료분석을 위한 
 
자료의 특성을 이해하기 위해
그래픽 표현
1) 시간에 따라 변화하는 개인별 패턴 인식
 
시간가변공변량이 있을 경우에는 cox ph model 사용
시간가변공변량이 이항자료 0r 연속형자료
결측치가 별로 없어야 한다...

연구 1

모형: gee 분석 /일반화추정방정식

Researh questions:
1) 20일간의 시간동안 수면패턴이 어떻게 변화하는가?
2) 20일간의 시간동안 스트레스 지수(시간가변공변량, 1-5), 카페인 섭취여부, 알코올 섭취여부이 수면점수에 어떻게 영향을 미치는가?
3) 스트레스 지수, 카페인, 알코올 간의 교호작용이 있는가?
 
시간고정공변량 : sex, age, height, weight
시간가변공변량: caffeine(binary), alcohol(binary), stresslevel(ordinal - 1,2,3,4,5)
반응변수 : sleep score (numerical)
 
상관 행렬에 따른 모형 적용
i) independenceii)exchangeableiii)AR(1)iv)unstructured
 
모형선택 - QIC 비교
 
시행착오
챗지피티쌔끼가 쌉구라를쳤다.
얘가 gee 모형에 시간가변공변량을 포함할수 있다고 당당하게 말했는데, 아무리해도 time varying covariate를 포함하는 방법은 모르곘음
그러다 이 문서를 봤는데 

"GMM Logistic Regression with Time-Dependent Covariates and Feedback Processes in SASTM"

partial gmm model이라는게 잇는데
그거는 sas에서만 사용이 가능하고 r에서는 안된다는것
 
그래서 sas로 급 종목 변경..,,,.
 
gmm model 설명을 찬찬히 읽고 있는 중인데, response variable이 binary variable이어야 한다고 함.
그래서 변경..
 

연구2

모형: Partial gmm

Researh questions:
1) 20일간의 시간동안 수면패턴이 어떻게 변화하는가?
2) 20일간의 시간동안 스트레스 지수(시간가변공변량, 1-5), 카페인 섭취여부, 알코올 섭취여부이 수면점수에 어떻게 영향을 미치는가?
3) 스트레스 지수, 카페인, 알코올 간의 교호작용이 있는가?
 
시간고정공변량 : sex, age, height, weight
시간가변공변량: caffeine(binary), alcohol(binary), stresslevel(ordinal - 1,2,3,4,5)
반응변수 : sleep disturbance(binary)
 
상관 행렬에 따른 모형 적용
i) independenceii)exchangeableiii)AR(1)iv)unstructured
 
모형선택 - QIC 비교

SAS MACRO

The partial GMM can be fit in SAS using the general macro call which mimics the arguments used in the %GMM macro introduced by Cai and Wilson (2015; 2016):

%partialGMM(ds=, file=, timeVar=, outVar=, predVar=, idVar=, alpha=);

The first argument DS is used to specify the location of the dataset, while the second argument file is used to reference the SAS file (.sas7bdat) to be analyzed. The next four arguments are used to identify specific variables in the data set which will be used in fitting the partial GMM. The timeVar argument identifies the variable name for the time points. The variables outVar and predVar identify the binary outcome variable and set of covariates, respectively. Multiple covariates can be analyzed and specified in the predVar statement, where each covariate should be delimited by a space. The idVar argument takes the subject identification variable. The last argument, alpha, refers to the significance level at which the correlations between the residuals and covariates will be tested for evaluating validity of the moment conditions.

As an example of the syntax for this macro, consider the call to the %partialGMM macro for the Medicare example discussed in the following section. The corresponding call is given by:

This macro relies on a number of base SAS procedures such as PROC LOGISTIC and PROC GENMOD to obtaining residuals for the logistic regression model, as well as appropriate starting values for optimization based on the GEE estimates. Identification of valid moment conditions as well as estimation of the model parameters and respective analyses are conducted primarily in PROC IML. Newton- Raphson optimization is used to identify the parameter values which minimize the objective function. The %partialGMM macro returns parameter estimates for each of the covariates (and the respective lags), along with estimates of the standard deviation, Z-value and P-value for the hypothesis 𝐻0: 𝛽𝑗 = 0. The lags are referenced by concatenating an underscore and a lag count for each of the covariates, where the lag count begins at 0 for the covariate relationships within the same time point (also called current time point) and end at 𝑇 − 1. For example, for a generic variable ‘𝑋’ with measurements taken at 3 time points, the macro will return estimates for 𝑋_0, representing the effect of X at the current time point, 𝑋_1, denoting the effect of X at a one time point lag and 𝑋_2, representing the effect of X at a two time point lag. The

%partialGMM(ds='C:\Users\Documents\IML',

file=Medicare,
timeVar=time,
outVar=biRadmit,
predVar=NDX NPR LOS DX101,
idVar=PNUM_R,

alpha=0.05);

 
TVM이라는 매크로가 사스에 있던데 코드가 돌아는 가나 어떻게 분석하는건지 잘 모르겠음 - 난수생성?시간가변공변량이 한종류밖에 안되는것같기도.

'Biostatistics' 카테고리의 다른 글

R시계열 분석  (1) 2023.06.11
닥터 윌슨의 GMM 시간가변공변량 모델  (0) 2023.06.10
목숨2개달린 프로젝트  (0) 2023.06.10