Showing posts with label statistics. Show all posts
Showing posts with label statistics. Show all posts

10.10.08

SURVIVAL ANALYSIS
Prepared by Jose Abraham

Survival analysis (also called time to event analysis) is concerned with studying the time between entry to a study and a subsequent event. These methods are most often applied to the study of deaths. In fact, they were originally designed for that purpose, which explains the name survival analysis. Survival analysis is an important medical concern and is extremely useful for studying events like onset of disease and recurrence of disease.

The point of survival analysis is to follow subjects over time and observe at which point in time they experience the event of interest. The data which is obtained from survival studies may contain censored observations. Censoring comes in many forms and occurs for many different reasons.

For example if we consider a cancer study in which the subjects after response from treatment were followed up for a specific period of time for the recurrence of cancer (event of interest). If a subject experiences recurrence at time t, which is not known exactly and all we know that the event occurred after a specific time T (i.e. t>T), then the last time at which the subject was observed is recorded and the survival time for that subject is considered as right censored. Also if the recurrence is experienced before a specific time, and the exact time is unknown, then the survival time recorded from that subject is considered as left censored. So the times obtained from subjects who are having no recurrence until the end of the study and those who were lost to follow up, before the end of the study period are censored.

In the aforesaid study, the basic structure of the data is that for each case there is one variable which contains either the time that recurrence happened or, for censored cases, the last time at which the case was observed, both measured from the chosen origin. Another variable that denotes the censoring status of each case is also present (uncensored =1 and censored=1). Also the data contain values of other variables such as markers, tissues etc…. A small part of data in this form is given below

data molecules;
input marker surv censor stage histo;
datalines;
0 75 1 2 1
1 115 0 3 2
1 96 1 1 1
0 110 0 2 3
0 178 0 3 2
1 149 1 2 3
1 163 1 4 4
0 211 1 1 2
1 167 1 2 1
0 195 0 2 1
1 140 1 3 4
0 202 0 4 4
0 153 0 2 2
1 147 0 1 3
0 132 0 4 1
0 178 1 3 2
;
run;

Analysis of censored data can be easily performed in SAS with the help of various procedures like PROC LIFETEST, PROC PHREG etc.The purpose of the analysis is to model the underlying distribution of the survival time variable and to assess the dependence of the survival time variable on the independent variables.

The Kaplan Meier curve is plotted by taking disease free survival time on the horizontal axis and survival probability on the vertical axis. This curve is useful to measure the proportion of patients surviving at a specific time. Also we can compare the survival experience of two groups by comparing their curves. This comparison of survival estimates can be done by making use of the strata statement in PROC LIFETEST. The significant differences of the Kaplan Meier curves can be tested by Logrank test. If the p-value in the log-rank test is large (>0.05) then we can say that there is no difference in survival. The piece of SAS code for doing this comparison of survival curves between those cases in which the marker is present (marker=1) and those in which it is not present (marker=0).

proc lifetest data= survdata method=km plots=(s,lls) outsurv=option;
time surv*censor (0);
strata marker;
run;

The strata statement provides the log rank test and Wilcoxon test statistics. The outsurv= option in the proc lifetest statement to create a SAS data set that has the KM survival estimates. Plots=(s, lls) produces log-log curves as well as survival curves. The log-log survival curves will be parallel or nearly parallel if the proportional hazard assumption is met.
We can make use of this lifetest procedure to compute the non parametric estimates of the survivor function by Kaplan Meier method. The option method=km in the PROC LIFETEST produces Kaplan-Meier survival estimates and the option Plots=(s) plots the estimated survival function. A part of SAS output showing the survival estimates and the Kaplan-Meier curve is given below

Kaplan – Meire Curves


Hazard ratio is a reasonable estimate for representing the effect of different factors in event occurrence. Cox regression model can be used and it models the time to event data. This can be done in SAS using the PROC PHREG. The following piece of code can be used to model the data

proc phreg data =molecules;
model surv*censor(0) =marker stage histo /rl ties=breslow selection=b;
baseline out=out1 survival=s logsurv=ls loglogs=lls;
run;

The backward selection procedure (with the option selection=b) in Cox’s regression removes the non-significant variables from the regression model and it includes only significant variables in the final model. The option ties= breslow is used to handle the ties. Proc phreg produces the regression coefficients and their standard errors for the variables which were included in the final model along with the p-values obtained from the Wald’s chi-square test. Hazard ratios and their 95% confidence intervals for those variables are also included in the output.

A part of the output is given below


Hazard ratios can be interpreted similarly as that of interpreting odds ratios, i.e. a hazard ratio of 1 for an explanatory variable can be interpreted as it has no effect on the hazard. While a hazard ratio less than 1 denotes that the variable effect results in a decreased hazard. And a hazard ratio greater than 1, denotes that the variable effect results in an increased hazard.
Cochran-Armitage Trend Test
Prepared by Sreeja E V

In clinical trials, it is often of interest to investigate the relationship between the increasing dosage and the effect of the drug under study. Usually the dose levels tested are ordinal, and the effect of the drug is measured in binary. In such cases, Cochran-Armitage trend test is most frequently used to test for trend.

Here, the Null hypothesis (H0): There is no linear trend in effect of the drug under study across increasing levels of dosage. Alternative hypothesis (H1): There is linear trend in effect of the drug under study across increasing levels of dosage.

Consider an example. The data set effect contains hypothetical data for a clinical trial of a case control study. The clinical trial investigates whether the variable cascon relates with different genotype statuses. Subjects have one of either three genotype statuses 1, 2 or 3 where 1 represents abnormal, 2 represents partially abnormal and 3 represents normal status. The variable cascon has values 1=’Case’ and 2=’Control’. The number of subjects for each group is represented by the variable Count.

data effect;
input status cascon Count @@;
datalines;
1 1 15 1 2 26
2 1 19 2 2 10
3 1 20 3 2 3
;
run;

proc freq data=effect;
tables status*cascon / trend measures cl;
weight Count;
title 'Clinical Trial for case control study’;
run;

The output will appear as follows

Cochran-Armitage Trend Test
*************************
Statistic (Z) 4.0252
One-sided Pr > Z <.0001
Two-sided Pr > Z <.0001
Sample Size = 93
We consider the two-sided -value tests against either an increasing or decreasing alternative. Using trend test we get Pr > Z <.0001. Thus the null hypothesis is rejected and it is concluded that there exists a trend in binomial proportions of response across gene status.
Calculation of adjusted odds ratio using Proc logistic
Prepared by Resmi Sukumar
Adjusted odds ratios are the odds of a dichotomous event adjusted for or controlling for other possible variables in the model. For example in a model where the response variable is the presence or absence of a disease, an odds ratio for a binomial exposure variable is an adjusted odds ratio for the levels of all other risk factor included in the model.

Adjusted odds ratio and corresponding 95% confidence interval is obtained by performing logistic regression analysis, this technique is implemented in the SAS® System using PROC LOGISTIC.

Logistic regression analysis provides adjusted odds ratio if adjustors are used as additional predictors, otherwise it provides unadjusted odds ratio.

The general syntax of PROC LOGISTIC is:

PROC LOGISTIC DATA=dsn ;
MODEL depvar = indepvar(s)/options;
RUN;

Example:
Suppose we are interested in conducting a case control study to evaluate the relation among cases and controls between different genotypes. The different gene statuses are ‘abnormal’ and ‘normal’ where normal is considered as referent group. For this purpose we generate a dataset as follows

/*Random data generation*/

data genestat;
do i=1 to 50;
gene=round(1 + (3-1)*uniform(10));
age =round(1+(3-1)*uniform(15));
ethnic=round(1+(3-1)*uniform(14));
status=round(1+(2-1)*uniform(16));
cascon=round(1+(2-1)*uniform(17));
output;
end ;
drop i;
run;

/*formats */
proc format;
value gene 1= 'Gene1' 2= 'Gene2' 3= 'Gene3';
value cascon 1='Case' 2='Control';
value age 1='<18' 2="'18-35'" 3="'">35';
value ethnic 1='Asian' 2='Caucasian' 3='Other';
value status 1='Abnormal' 2='Normal ';

proc sort data=genestat ;
by gene;
format gene gene. cascon cascon. status status. age age. ethnic ethnic.;
run;

Let’s consider a model with variable status, age and ethnic are as predictors.

/*proc logistic for calculating adjusted odds ratio*/
ods trace on;
ods output CLoddsWald=gene_cancer(where=(Effect="status Abnormal vs Normal"));

proc logistic data=genestat;
class status/param=ref ref=last;/* reference parameter ref=last
i.e. ref='Normal'*/
model cascon=status age ethnic / clodds=both;/* clodds =gives WALD confidence Interval for odds ratio*/
by gene ;
run;

ods output close;
ods trace off;

The MODEL statement names the response variable and the explanatory effects, including covariates, main effects, interactions, and nested effects. The CLASS statement names the classification variables to be used in the analysis. The CLASS Statement permits specification of a reference level. By default, the lowest level of the variable placed in the CLASS Statement is treated as the reference category. The BY statement is used to obtain separate analyses on observations in groups defined by the BY variables.

The output table is obtained as

This shows that Gene1 and Gene2 are less likely to have the abnormal genotype status in case than control. Adjusted odds ratio for Gene3 shows that the odds of abnormal genotype occurring in the case group are higher than it occurring in control group.

Let's now consider the model where status is the only predictor.

/*proc logistic for calculating unadjusted odds ratio*/
ods trace on;
ods output CLoddsWald=gene_cancer(where=(Effect="status Abnormal vs Normal"));

proc logistic data=genestat;
class status/param=ref ref=last;/* reference parameter ref=last
i.e. ref='Normal'*/
model cascon=status / clodds=both;/* clodds =gives WALD confidence interval
for odds ratio*/
by gene ;
run;

ods output close;
ods trace off;

The output table is obtained as


This shows that the odds of abnormal genotype occurring in the case group are higher than it occurring in control group for gene 3 while it same for genes 1 and 2.

24.9.08

Kreara - Clinical Data management and Biomterics

21.9.08

Odds ratio
Prepared by Prajitha Nair & Sreeja E V

In order to quantify the association between the exposure and the outcome of interest the incidence of disease in a group of individuals exposed to the supposed risk factor must be compared with the incidence in a group of persons not exposed. This comparison can be summarized by calculating either the ratio of the measures of disease occurrence for the two groups, which indicates the likelihood of developing the disease in the exposed individuals relative to those unexposed.In case-control studies, it is not possible to directly estimate disease incidence in those exposed and those unexposed, since people are selected on the basis of having or not having the condition of interest, not on the basis of their exposure status. It is however, possible to calculate the odds of exposure in the cases and in the controls.The odds ratio (OR) estimates the magnitude of association between the exposure and outcome. It is defined as the ratio of odds of an event occurring in one group to the odds of it occurring in another group, or to a sample-based estimate of that ratio. These groups might be an experimental group and control group.The 2x2 contingency table showing the relationship between the exposure and the disease is presented as follows:


Probability of being exposed among cases=a/(a+c)Probability of being non-exposed among cases=c/(a+c)Odds of being exposed among cases=a/cProbability of being exposed among controls=b/(b+d)Probability of being non-exposed among controls=d/(b+d)Odds of being exposed among controls=b/dOdds ratio = (odds of being exposed among cases)/ (odds of being exposed among controls)= (a/c)/ (b/d)= (a*d)/ (b*c)
In strict terms, the odds ratio obtained tells us how many more (or less, if the exposure is associated with a reduced risk) times likely the cases are to have been exposed to the factor under study compared with the controls.

If odds ratio is equal to 1 then this implies that the condition or event under study is equally likely in both groups. An odds ratio greater than 1 indicates that the condition or event is more likely in the first group. An odds ratio less than 1 indicate that the condition or event is less likely in the first group. The odds ratio can vary from zero to infinity.

Odds Ratio using SAS
Prepared by Prajitha Nair


In the case-control study, the risk of cervical cancer was examined in relation to a gene XXXX. The status of the genes is abnormal and normal wherein normal is considered as the referent category.

Consider an example:data gene;input cat $7. genstatus $4. count;cards;case abn 119control abn 68case nor 317control nor 319;run;

ods output RelativeRisks=relrisk(where=(studytype="Case-Control (Odds Ratio)"));proc freq data=gene ;tables cat*genstatus/relrisk ;weight count;run;ods output close;

The table will be as follows:

Odds of exposure among cases=119/317Odds of exposure among controls=68/319Odds ratio= odds of exposure among cases/odds of exposure among controls =1.76

The odds ratio with respect to XXXX shows that the odds of abnormal genotype occurring in case group is 1.76 times higher than it occurring in control group. The 95% confidence interval for the odds ratio is obtained as (1.26, 2.46).The cervical cancer cases were 76% more likely to have abnormal genes than controls. In short, the odds ratio indicates that women who have abnormal genes were 76% more likely to develop cervical cancer than those with normal genes.


2.7.07

Wilcoxon rank-sum test

The Wilcoxon rank-sum test is a non-parametric analog of the two-sample t-test. It is based on ranks of the data, and is used to compare location parameters, such as the mean or median, between two independent populations without the assumption of normally distributed data.


DATA RNKSM;
INPUT TRT $ PAT SCORE @@;
DATALINES;
SER 2 0 SER 3 2 SER 5 3 SER 6 3
SER 8 -2 SER 10 1 SER 12 3 SER 14 3
SER 16 -1 SER 17 2 SER 20 -3 SER 21 3
SER 22 3 SER 24 0 SER 26 2 SER 27 -1
PBO 1 3 PBO 4 -1 PBO 7 2 PBO 9 3
PBO 11 -2 PBO 13 1 PBO 15 0 PBO 18 -1
PBO 19 -3 PBO 23 -2 PBO 25 1 PBO 28 0
;

PROC NPAR1WAY WILCOXON DATA = RNKSM;
CLASS TRT; VAR SCORE;
TITLE1 'The Wilcoxon Rank-Sum Test';
RUN;

1.7.07

Van Elteren's test

You can think of van Elteren's test as analogous to an analysis of variance with a blocking factor. One common use of the van Elteren test is with clinic as the stratification variable in a multicenter clinical study. van Elteren's test is used in lieu of randomized blocks ANOVA with clinics as blocks. In the case of a geographically distributed study we could use this test with country as a blocking factor

Here is how we could perform the test in SAS

data a;
input blocks treatmnt consump @@;
datalines;
1 1 236 1 2 255
2 1 183 2 2 179 2 2 193
3 1 115 3 1 128 3 2 132
4 1 61 4 1 70 4 1 79 4 2 67 4 2 84 4 2 88
;

proc freq;
tables blocks * treatmnt * consump / cmh2 scores=modridit noprint;
run;

28.6.07

Sample Size Calculations for Comparisons Between Proportions
Sample Size Calculations for Comparisons Between Means


27.6.07

Hypothesis testing

In studies concerned with detecting an effect (e.g. a difference between two treatments, or relative risk of a diagnosis if a certain risk factor is present versus absent), sample size calculations are important to ensure that if an effect deemed to be clinically meaningful exists,then there is a high chance of it being detected, i.e. that the analysis will be statistically significant. If the sample is too small, then even if large differences are observed, it will be impossible to show that these are due to anything more than sampling variation. There are different types of hypothesis testing problems depending on the goal of the research.

Let μS = mean of standard treatment, μT = mean of new treatment, and δ = the minimum clinically important difference.

1. Test for Equality: Here the goal is to detect a clinically meaningful difference/effects is such a difference/effects exists
2. Test for Non-inferiority: To demonstrate that the new drug is as less effective as the standard treatment (ie the difference between the new treatment and the standard is less than the smallest clinically meaningful difference)
3. Test for Superiority: To demonstrate that the new treatment is more superior that standard treatment (ie the difference between the new treatment and the standard is greater than the smallest clinically meaningful difference).
4. Test for equivalence: To demonstrate the difference between the new treatment and standard treatment has no clinical importance

It is important to note that
the test for superiority is often referred to as the test for clinical superiority
If
δ = 0, it is called the test of statistical superiority
Equivalence is taken to be the alternative hypothesis, and the null hypothesis is nonequivalence

26.6.07

P value

The p-value is the probability of obtaining the effect as extreme or more extreme than what is observed in the study if the null hypothesis of no effect is actually true. It is usually expressed as a proportion (e.g. p=0.001).
Hypothesis

Many statistical analyses involve the comparison of two treatments, procedures or subgroups of subjects. The numerical value summarizing the difference of interest is called the effect.

In other study designs the effect may be
a. Odds ratio (OR): H0 : OR=1
b. Relative risk (RR): H0 : RR=1
c. Risk Difference (RD): H0 : RD=0
d. Difference between means:H0 : Difference = 0
e. Correlation Coefficient : H0 : CC=0

Note that usually, the null hypothesis H0 states that there is no effect and the alternative hypothesis that there is an effect.