The script begins by creating an 'ossification' dataset from embedded data (datalines), representing the results of an experiment on litters with different treatments (PHT, TCPO). A first GEE model is fitted with an independent working correlation matrix. Then, the data is transformed into a binary format (one record per subject) in the 'ossification_b' dataset. A second GEE model is then fitted to this transformed data, this time using an exchangeable working correlation matrix. The results of both analyses are generated in HTML format.
Data Analysis
Type : CREATION_INTERNE
The data is entirely generated within the script via a 'datalines' statement in the first DATA step.
1 Code Block
DATA STEP Data
Explanation : Creates the 'ossification' dataset by reading data directly from the code via 'datalines'. Each data line represents a litter and the number of successes (t) out of a number of trials (m) for different treatments (tx). Indicator variables (PHT, TCPO) are created to model treatment effects.
Explanation : Fits a Generalized Estimating Equations (GEE) model to the data. The model uses a binomial distribution with a logit link to model the proportion of successes (t/m) as a function of treatments. A repeated measures analysis is performed on litters, assuming an independent working correlation structure (type=ind).
Copied!
ods html;
title "*** Ossification Data -- GEE using GENMOD with Independent Working Correlation Matrix***";
proc genmod data=ossification;
class litters tcpo pht / param=ref;
model t/m = tcpo pht tcpo*pht / dist=binomial link=logit;
repeated subject=litters / type=ind;
run;
ods html close;
1
ods html;
2
title "*** Ossification Data -- GEE using GENMOD with Independent Working Correlation Matrix***";
3
PROC GENMODDATA=ossification;
4
class litters tcpo pht / param=ref;
5
model t/m = tcpo pht tcpo*pht / dist=binomial link=logit;
6
repeated subject=litters / type=ind;
7
RUN;
8
ods html close;
3 Code Block
DATA STEP Data
Explanation : Transforms the aggregated 'ossification' dataset into a binary format. For each litter, it creates 't' observations with a response variable 'y' equal to 1 (success) and 'm-t' observations with 'y' equal to 0 (failure). This format is required for certain types of binomial analysis.
Copied!
data ossification_b;
set ossification;
do i=1 to t;
y = 1;
output;
end;
do i=1 to m-t;
y = 0;
output;
end;
run;
1
DATA ossification_b;
2
SET ossification;
3
DO i=1 to t;
4
y = 1;
5
OUTPUT;
6
END;
7
DO i=1 to m-t;
8
y = 0;
9
OUTPUT;
10
END;
11
RUN;
4 Code Block
PROC GENMOD
Explanation : Fits a second GEE model using the binary 'ossification_b' dataset. The model is similar to the first but specifies an exchangeable working correlation structure (type=exch), assuming a constant correlation between all observations within the same litter.
Copied!
ods html;
title "*** Ossification Data -- GEE using GENMOD with Exchangeable Working Correlation Matrix***";
proc genmod data=ossification_b descending;
class litters tcpo pht / param=ref;
model y = tcpo pht tcpo*pht / dist=binomial link=logit;
repeated subject=litters / type=exch;
run;
ods html close;
1
ods html;
2
title "*** Ossification Data -- GEE using GENMOD with Exchangeable Working Correlation Matrix***";
3
PROC GENMODDATA=ossification_b descending;
4
class litters tcpo pht / param=ref;
5
model y = tcpo pht tcpo*pht / dist=binomial link=logit;
6
repeated subject=litters / type=exch;
7
RUN;
8
ods html close;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Related Documentation
Aucune documentation spécifique pour cette catégorie.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.