analyzing baseline follow-up studies with sas proc...

30
Analyzing baseline follow-up studies with SAS PROC MIXED Statistical analysis of correlated and repeated measurements for health researchers Julie Forman, Section of Biostatistics, University of Copenhagen Introduction In what follows I will describe how to analyze data from longitudinal baseline follow-up studies with PROC MIXED in SAS. I will describe the appropriate analyses for: 1. Single group studies (the easy case, much like oneway ANOVA). 2. Parallel group studies (a little harder, much like twoway ANOVA with interaction). 3. Randomized group studies (the tricky case, but most often used in practice). and, of course, the basic data management that is needed to prepare data for analysis as well as some descriptive statistics that will help you to get an overview of your data. All of these analyses apply to data from balanced study designs meaning that follow-up times are planned to be the same for all subjects in the study (contrary to retrospective registry studies where e.g. times of visiting the doctor may differ quite substantially between patients). Note that in practice data is often collected not exactly on schedule and for some subjects data will be missing on one or more occations due to drop out, technical problems etc. Valid mixed model analyses can still be performed with missing data as long as 1) the study design remains balanced, 2) there are no systematic biases in who is seen ahead of/ behind schedule, and 3) missing data are missing at random (please refer to lectures 2 and 6 for further explanation). Case study: a randomized study on chronic kidney disease Throughout this chapter I will use data from Boesby et al (2013): Eplerenone Attenuates Pul- se Wave Reflection in Chronic Kidney Disease Stage 3–4 - A Randomized Controlled Study, PLOS ONE 8(5). In this randomized study a novel treatment, Eplerenone, was compared to a standard treatment in patients with chronic kidney disease (CKD). The data from the CKD study and the SAS code I have used to analyze it is contained in the files cdkwide.txt and ckd-demo.sas found at the course webpage. 1

Upload: others

Post on 21-Sep-2020

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Analyzing baseline follow-up studieswith SAS PROC MIXED

Statistical analysis of correlated and repeated measurements for health researchers

Julie Forman, Section of Biostatistics, University of Copenhagen

Introduction

In what follows I will describe how to analyze data from longitudinal baseline follow-up studieswith PROC MIXED in SAS. I will describe the appropriate analyses for:

1. Single group studies (the easy case, much like oneway ANOVA).

2. Parallel group studies (a little harder, much like twoway ANOVA with interaction).

3. Randomized group studies (the tricky case, but most often used in practice).

and, of course, the basic data management that is needed to prepare data for analysis as well assome descriptive statistics that will help you to get an overview of your data.

All of these analyses apply to data from balanced study designs meaning that follow-up timesare planned to be the same for all subjects in the study (contrary to retrospective registry studieswhere e.g. times of visiting the doctor may differ quite substantially between patients). Notethat in practice data is often collected not exactly on schedule and for some subjects data willbe missing on one or more occations due to drop out, technical problems etc. Valid mixedmodel analyses can still be performed with missing data as long as 1) the study design remainsbalanced, 2) there are no systematic biases in who is seen ahead of/ behind schedule, and 3)missing data are missing at random (please refer to lectures 2 and 6 for further explanation).

Case study: a randomized study on chronic kidney disease

Throughout this chapter I will use data from Boesby et al (2013): Eplerenone Attenuates Pul-se Wave Reflection in Chronic Kidney Disease Stage 3–4 - A Randomized Controlled Study,PLOS ONE 8(5). In this randomized study a novel treatment, Eplerenone, was compared toa standard treatment in patients with chronic kidney disease (CKD). The data from the CKDstudy and the SAS code I have used to analyze it is contained in the files cdkwide.txt andckd-demo.sas found at the course webpage.

1

Page 2: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 1: CKD study: Augmentation indices (AIX) following treatment initiation in newly diag-nosed patients with chronic kidney disease. Outcomes are shown at baseline (0 weeks) and after12 and 24 weeks of treatment with either Eplerenone or standard treatment (control group).

To highlight the differences between the twoway ANOVA type linear mixed model for parallel(i.e. non-randomized) group studies and the constrained linear mixed model for randomizedstudies, I have applied both models to the same data even though the second is the most apro-priate (the first approach is not outright wrong but it is suboptimal). For the same reason, allanalyses were carried out with the augmentation index (AIX) as outcome although this was asecondary outcome in the original study. It should be noted that, even though the estimated ef-fect on the primary outcome matched the presumed beneficial effect of Eplerenone anticipatedin the power calculation, the study was de facto underpowered and failed to reach the 5% levelof significance.

Preparing data for analysis

A trimmed version of the original records from the CKD study are contained in the datafileckdwide.txt. It contains the following variables:

id Study ID number.sex Patients gender (1=male, 2=female).age Patients age in years.treatgroup Treatment group (0=control, 1=Eplerenone).aix0 Augmentation index (%) at baseline (just before initiation of treatment).aix1 Augmentation index (%) after 12 weeks of treatment (safety visit).aix2 Augmentation index (%) after 24 weeks of treatment (end point).

It is possible to read data into SAS from the datafile using a program like the one below. Pleasenote that you have to save the datafile and change the path in the program so that it matches thelocation on your computer where the file can be found.

2

Page 3: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

/* Read in the data from the textfile */

DATA ckdwideINFILE "C:\courses\statistics\repeated\ckdwide.txt" FIRSTOBS=2;INPUT id sex age treatgroup aix0 aix1 aix2;RUN;

Note that since the first line in the datafile contains the variable names you have to tell SASthat the actual recordings start in the second line (the command FIRSTOBS=2) and supply thevariable names (in the correct order) in a INPUT-statement.

However, knowing that importing data into SAS can be tricky, I have made a copy of the datawithin the program file ckd-demo.sas. If you want to get started on doing linear mixed mo-del analyses straight away, you can run this instead.

This is what it looks like:

/* Generate data within SAS */

DATA ckdwide;INPUT id sex age treatgroup aix0 aix1 aix2;DATALINES;1 1 57 0 10.5 17.5 252 1 48 0 -2.5 8 8.53 2 54 1 18 24 23.5

(51 records in total)

53 2 71 0 27.5 31 36.554 1 67 0 18.5 24 29.5;RUN;

Once you highlight and submit this code in SAS, a dataset called ckdwide is created. In En-terprise guide the data opens automatically in an Excell-like output data window, while in baseSAS you need to locate it in the explorer window to open it (don’t forget to close it again beforeyou continue working with the data). As appears the dataset contains seven variables (the onesnamed in the INPUT-statement) and 51 records (id-numbers range from one to 54 but threepatients dropped out of the study before the baseline visit). It is important to notice that all vari-ables appear as numerical in SAS, they are considered as numbers unless we specifically tell theprogram to treat them differently. However, we should bear in mind that treatment and genderare truly categorical variables which are coded as 1 for Eplerenone, 0 for control treatment, and1 for male, 2 for female, repectively.

3

Page 4: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

The long and the wide format

In order to perform longitudinal data analyses and other mixed model analyses it is importantto distinguish two different formats for the same data.

1. The wide format with one record (line in the data) per subject.

2. The long format with several records (lines in the data) per subject, one for each occation.

The dataset ckdwide is in the wide format, all data from the same person is contained in asingle line. This is the natural format when entering the trial data in a database (e.g. an Excellspreadsheet) because it is compact and makes it easy to compare measurements from the sameperson between the different occations. E.g the record from the patients with id=1 and id=3 inthe ckdwide data reads:

id sex age treatgroup aix0 aix1 aix21 1 57 0 10.5 17.5 25.03 2 54 1 18 24 23.5

From this we see that id=1 is a male patient aged 57 who received standard treatment and whoseaugmentation index increased from 10.5 at baseline to 25.0 at final follow-up. Similarly id=3is a female patient aged 54 who received eplerenone and whose augmentation inxed increasedfrom 18 at baseline to 23.5 at final follow-up.

However, to perform a mixed model analysis data must be presented to SAS in the so-calledlong format where each measurement appear in separate lines in the dataset and an additionalvariable identifies the occation. E.g. in the CKD-data the patient with id=1 contributes threerecords, one from week 0 (baseline), one from week 12, and one from week 24:

id week sex age treatgroup aix1 0 1 57 0 10.51 12 1 57 0 17.51 24 1 57 0 25.03 0 2 54 1 183 12 2 54 1 243 24 2 54 1 23.5

Note that there are some redundancies in the long data, the variables id, sex, age, andtreatgroup do not change between occations and thus the same number is recorded three-fold. In contrast there is only one outcome variable aix which changes between occations,while three variables aix0, aix1, and aix2 were needed to contiain the repeated measure-ments in the wide data.

4

Page 5: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Transforming data from the wide to the long format

Fortunatly we do not have to rearrange data manually to make a long version that can be usedin the analyses. The following SAS code transforms the data from ckdwide and stores it in anew dataset ckdlong which is in the long format:

DATA ckdlong (DROP = aix1-aix2);SET ckdwide;week = 0; aix = aix0; OUTPUT;week = 12; aix = aix1; OUTPUT;week = 24; aix = aix2; OUTPUT;RUN;

Please check the new dataset in the output data window (or by opening it with the explorer).Make sure to notice the difference between the wide and the long data format.

Descriptive statistics

Before we proceed to making statistical analyses I will show you how to make descriptivestatistics suitable for longitudinal data analyses. In particular making graphical displays of thedata will help us to:

• Spot erroneous measurements that could otherwise spoil the results of your analyses.

• Make a rough assessment of the trends in the data which will help us when interpretingthe output from the formal mixed model analyses.

• Judge wheter data is approximately normally distributed or should be transformed tobetter fulfill modeling assumptions

Some of the descriptive statistics presented below are absolutely essential for aiding the analy-ses, they will help you correct errors in your SAS code as well as in your data. Others I haveincluded for pedagogical reasons to help you become familiar with linear mixed models and themultivariate normal distribution.

Spaghettiplots

Personally I would never do a longitudinal data analysis without first looking at spaghettiplots.The spaghettiplot is the most informative display since it contains all of the raw data. From thiswe can get an impression of both individual outcomes (any weird ones?) and the distributionacross the sample (trend, variation, symmetric or skewed?, weak or strong correlation?). Tomake a single spaghettiplot in SAS we use PROC SGPLOT, while PROC SGPANEL allows usto compare the spaghettiplots across e.g. treatment groups like in the CKD study:

5

Page 6: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

PROC SGPANEL DATA = ckdlong;PANELBY treatgroup / ROWS=1;SERIES x = week y = aix / GROUP = id;RUN;

Please note that SGPLOT/SGPANEL applies to data in the long format. The SERIES statementconnects the datapoints belonging to the same id. If you want to make a plot of a single group,you should change SGPANEL to SGPLOT and omit the PANELBY statement.

Figur 2: Spaghettiplots made with PROC SGPANEL

Scatterplot matrices

If you want to get an impression of how strong the correlation is between your repeated measu-erements and whether they are multivariately normally distributed, you can make scatterplot ma-trices with PROC CORR which also computes means, standard deviations and cross-correlationsbetween the observations at the various occations.

When multiple treatments/groups are considered as in the CKD study it is apropriate to makeone scatteplot matrix for each group. PROC CORR will make all of them in one go if you usea BY statement (and if the data has been sorted accordingly before you run it).

PROC SORT DATA = ckdwide;BY treatgroup;RUN;

PROC CORR DATA = ckdwide PLOTS=MATRIX(HISTOGRAM) NOPROB;BY treatgroup;VAR aix0 aix1 aix2;RUN;

6

Page 7: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Note that PROC CORR applies to data in the wide format and all the variables containing therepeated measurements must be mentioned in the correct order.

Figur 3: Scatterplot matrices from the CKD study made with PROC CORR

When checking at the resulting scatterplots, you should look for the elliptical shape that cha-racterizes the multivariate normal distribution. Beware, however, that the usual problem withchecking normality recurrs: If sample sizes are small the assumption that data is normally di-stributed is important but impossible to verify (therefore small sample size should always berecognized as a limitation), while if sample sizes are large the linear mixed model is robust toall but substantial skewness and major outliers. If the data deviates a lot from the normal distri-bution, you can try to improve the fit by applying a transformation, e.g. a logarithm. When indoubt either stick to the original data or consult with a statistician.

Figur 4: Cross correlations from the CKD study computed with PROC CORR. Left: Controlgroup. Right: Eplerenone group.

Finally, I would like to point out that spaghettiplots are usually sufficient to get a feel for thedistribution of the data and that the output you get from PROC MIXED when running the mixedmodel analysis includes residual plots that are better for judging normality (since data can bejoined across groups and occations) as well as estimated cross-correlations.

7

Page 8: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Trends in summary statistics over time

PROC MEANS offers a larger selection of summary statistics compared with PROC CORR(e.g. quantiles) and allows you to store these in an output dataset which is useful if you want toplot them. The program below stores the sample means from the ckd study in an output datasetcalled ckdmeans in order to plot them over time and compare them between the groups.

PROC MEANS NWAY DATA = ckdlong N NMISS MEAN STDDEV MIN MEDIAN MAX;CLASS treatgroup week;VAR aix;OUTPUT OUT = ckdmeans MEAN = samplemean;RUN;

It is important to include the option ’NWAY’ in the PROC statement since otherwise PROCMEANS will compute additional summary statistics, e.g. averaging all outcomes for each groupregardless of occation which is not meaningfull.

Figur 5: Trends in sample means from the CKD study computed with PROC MEANS andplottet with PROC SGPLOT.

To plot the sample means of the two treatment groups over time apply PROC SGPLOT to theoutput dataset.

PROC SGPLOT DATA = ckdmeans;SERIES X = week Y = samplemean / GROUP = treatgroup MARKERS;RUN;

8

Page 9: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 6: Summary statistics from the CKD study computed with PROC MEANS

Finally note that PROC MEANS applies to the data in the long format and therefore cannotcompute correlations like PROC CORR.

1. Analysis of single group studies

In a longitudinal single group study a single homogeneous population is followed over timeand the research interest will be to describe systematic changes in the outcome. From a stati-stical point of view this means that we wish to compare population means between differenttime points while acknowledging the correlation in the repeated measurements on the the samesubject.

For illustration I will analyze the data from the control group in the CKD study to describethe natural disease progression in patients after the initiation of standard treatment. I will makefurther analyses to compare the disease progression between the Eplerenone and control groupin sections 2 and 3 below, but we start out with the single group model to make the introductionto linear mixed models as simple as possible.

Occation Population mean with control treatmentweek=0 µ1 = β0week=12 µ2 = β0 +β1week=24 µ3 = β0 +β2

Tabel 1: Population means (µ) over time expected with the control treatment of the CKD stu-dy. Changes in means over time are described by regresssion parameters (β1 and β2) with thebaseline mean as intercept (β0).

To perform the single group analysis we specify a linear mixed model with occation (week inthe CKD study) as a categorical covariate like in a oneway ANOVA model. To account for thecorrelation in the data as well as possible changes in variance/standard deviation over time wespecify an unstructured covariance pattern which needs a bit of explanation offered below.

9

Page 10: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Mean and covariance parameters

A multivariate normal distribution is described by two sets of model parameters, the mean-vector and the covariance-matrix.

The mean-vektor is the list of means for each occaion,

Mean =

µ1µ2µ3

like in the above table where they have been rephrased in terms of the regression coefficients ina oneway ANOVA model.

The covariance-matrix,

Covariance =

σ21 σ12 σ13

σ21 σ22 σ23

σ31 σ32 σ23

contains the population variances from each occation on its diagonal and the covariances be-tween outcomes from different occations off the diagonal. Please recall that the covariance isthe numerator in the mathematical formula defining the correlation coefficient, e.g.

ρ12 = Corr(Y1,Y2) =Cov(Y1,Y2)

SD(Y1) ·SD(Y2)=

σ12

σ1 ·σ2.

Moreover, the covariances are symmetric, e.g. σ12 = σ21, so the covariance matrix consideredhere contains six parameters in total, three variances and three correlations.

From an applied point of view the correlation coefficient has a more direct interpretation thanthe covariance, just like the standard deviation (σ ) has a more direct interpreation than the vari-ance (σ2). However, from a mathematical point of view phrasing the multivariate normal modelin terms of variances and covariances lead to more straightforward computations and therefo-re these are part of the standard output from PROC MIXED whereas standard deviations andcorrelations are not. Further note that there is a one-to-one correspondence between variances-covariances and standard deviations- correlations, if you know either you can compute the other.

The unstructured covariance pattern

As long as the number of occations is small compared to the number of subjects in the stu-dy we do not have to make any restrictive assumptions about the covariance parameters (suchan assumption could be that the variance was constant over time, i.e. that σ2

1 = σ22 = σ3

3 ). Byleaving the covariance matrix unrestricted, we say that we assume an unstructured covariancepattern. I would recommend specifying any linear mixed model with as unstructured covari-ance pattern as far as possible since this guarantees that we are not making any wrong modelassumptions (with the possible exception of assuming a normal distribution in the first place).

10

Page 11: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

SAS program - just the essential parts

Please note that the analysis has been restricted to the data from the control group (by use of aWHERE-statement).

PROC MIXED DATA = ckdlong;WHERE treatgroup EQ 0; /* control group only */CLASS id week (REF=’0’);MODEL aix = week / SOLUTION CL DDFM = KR;REPEATED week / SUBJECT = id TYPE = UN;RUN;

As to the essential parts of the code:

• Note that PROC MIXED applies to data in the long format.

• Don’t forget that all categorical variables must be declared in the CLASS-statement. UseREF to set the reference category (intercept) otherwise SAS chooses the one last in alpha-betic/numerical order by default. Note that if you forget declaring week as a categoricalcovariate, then SAS makes a linear regression model which is unfortunate as disease doesnot a priori progress linearly with time.

• The MODEL-statement specifes which variable is the outcome (left of =) and which arethe covariates (right of =).

• SOLUTION and CL are options to the MODEL-statement which produce estimates andconfidence intervals in the output.

• DDFM = KR is an additional technical option which makes corrections to the degrees offreeedom improving the validity of the tests (p-values) when the sample sizes are small.

• The REPEATED statment specifies the model for the covariance, in this case an unstruc-tured covariance pattern (TYPE=UN), for repeated measurements at different occations(corresponding to the variable week) on the same SUBJECT (given by the variable id).

SAS program - with additional useful output

In this extended version of the SAS program I have added some non-essential options to produceadditional output:

PROC MIXED DATA = ckdlong PLOTS = ALL;WHERE treatgroup EQ 0; /* control group only */CLASS id week (REF=’0’);MODEL aix = week / SOLUTION CL DDFM = KR VCIRY OUTPM=ckdfit1;REPEATED week / SUBJECT = id TYPE = UN R RCORR;RUN;

11

Page 12: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Some explanation for the code:

• PLOTS=ALL generates residualplots (if ODS GRAPHICS is on) allowing you to assessyour models fit to the data. Note that the ordinary residuals are hard to assess if thevariance is truly heterogeneous (changes with time). The studentized residuals (or highlysimilar Pearson residuals) have been standaradized to make the variance homogeneousbut still come in correlated chucks which makes the fit to the normal distribution difficultto assess since the effective sample size is smaller than the actual sample size.

• The VCIRY-option produces additional residualplots of the so-called scaled residualswhich are directly comparable to the standard normal distribution and with an effectivesample size that matches the actual sample size because variance heterogenity and cor-relations in the residuals has been removed prior to plotting. The drawback, however, isthat it is difficult to trace the source of eventual deviations from normality.

• The OUTPM-option makes an output dataset containing the estimated means for eachcombination of covariates appearing in the data. I use these to make a visualisation ofthe trend in the means over time. For more complex models these are often useful forchecking that the model I am analyzing with PROC MIXED is actually doing what Iintended. To make the plot I use:

PROC SORT DATA=ckdfit1;BY week id;RUN;

PROC SGPLOT DATA=ckdfit1;SERIES X=week Y=pred / MARKERS MARKERATTRS=(SYMBOL=circlefilled);SERIES X=week Y=lower / LINEATTRS=(COLOR=black PATTERN=dash);SERIES X=week Y=upper / LINEATTRS=(COLOR=black PATTERN=dash);RUN;

Just to show off, I have added confidence intervals to the plot and changed the coloringand line types to my liking.

• The options R and RCORR outputs the estimated covariance and correlation matrices,respectively. Although not of primary interest, these may be useful e.g. to make powercalculations for future studies and for a deeper understanding of mixed models overalland your data in particular.

The most important parts of the output

Admittedly PROC MIXED produces quite an overwhelming amout of output. Here I will descri-be the most interesting parts. I plan to add a commented version of the complete output in anappendix in the next version of these notes.

12

Page 13: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Model specification and convergence: The first part of the output from PROC MIXED is atechnical summary of what kind of repeated measurements analysis has been performed, whatdata it has been applied to, and what numerical optimisation SAS has performed. Most oftenthis is not at all interesting, but I recommend that you make a fast check to rule out technicalproblems and some frequently occuring errors in then programming:

Figur 7: Technical summary of the oneway ANOVA-type mixed model analysis.

What you need to look out for is:

• Convergence criteria met at the end of the Iteration History tells us that the numericaloptimisation has succeeded. In case this fails, SAS may output no estimates and test atall or, even worse, some that cannot be trusted. Convergence issues may be the result ofsimple errors in the program, e.g. applying the model to the wrong dataset or of applyingan overly complex model to a small dataset. If you cannot make PROC MIXED convergeand you cannot find a simple way to fix the problem, you should consult with a statistician.

• Model Information tells us that the analysis was applied to the ckdlong dataset thatis stored in SAS’ working memory, that the outcome in the analysis is the aix variable,

13

Page 14: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

that an unstructured covariance patterne was assumed to adjust the analysis for the depen-cy between the repeated measurements, and that the variable id identifies the subjects.Further we are told that PROC MIXED uses the REML-method to estimate the modelparameters. This is default and all fine unless you have a very specific reason for doingML-estimation which is the alternative. Finally, we are reminded that the Kenward-Rogermethod is used to do small sample corrections to the tests. This is just what we intendedwhen supplying the DDFM=KR option to the program.

• Dimensions and Number of Observations tells us firstly about the number of covarianceparameters (3 variances and 3 correlations in the unstructured covariance equals 6 intotal). Further down the number of subjects is 25 matching the number of persons in thecontrol group. We are told that each subject contribute a maximum of 3 observations inthe data. Of the 25*3=75 records read from the dataset, however, only 72 are used byPROC MIXED since the remaining 3 have missing values of either a covariat or, as inthis case, the outcome.

• I omit further description of the Iteration History and the number of Columns in X, Z asthese are mathematical details which are seldomly of any practical interest.

Estimates and confidence intervals: The most interesting part of the output is the estimatedtime-effect, i.e. the estimated mean change in AIX occuring from baseline to the safety visitafter 12 weeks and the end point visit after 24 weeks, respectively. Note that, since week=0has be set as reference point, the intercept in this model correspons to the population mean AIXat baseline (i.e. prior to initiation of treatment).

Figur 8: Estimates from the oneway ANOVA-type mixed model analysis.

As appears mean AIX has increased significantly from baseline to end point, corresponding toa mild worsening in the patient population overall. This may seem a bit of a surprise but afterallchronic kidney disease is a severe illness which is difficult to treat.

Type 3 tests: If you’d rather test the hypothesis H0 : µ1 = µ2 = µ3, i.e. that no changes inmeans whatsoever occur over time. This is exactly what you get from the type 3 test:

Note the usual limitation of the type 3 test: If the hypothesis is rejected, further comparisonswould be needed to investigate between which particular time points significant differences oc-cur. If you want to perform these pairwise comparisons, I would recommend that you skip theinitial type 3 test and make proper adjustment for multiple testing. Note that this is beyond thescope of these introductory lecture notes, but I can show you how to do it if you ask me.

14

Page 15: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 9: Type 3 tests from the oneway ANOVA-type mixed model analysis.

As to the exemplified analysis you might wonder why no significant effect of time is found.It seems like a contradiction since we just noted a significant change from baseline to end point.However, making the specific comparison between baseline and end point (where the largestchange was anticipated) is a more powerfull test. Don’t forget that lack of evidence is not thesame as lack of effect (and that the CKD study was in fact underpowered).

Additional interesting output

Residualplots are useful for checking the modeling assumption that data follows a multivariatenormal distribution and for detecting outliers in the data. SAS offers a wider selection of dif-ferent residuals but I usually only look at the studentized and the scaled ones which are mostdirectly comparable to the standard normal distribution (in QQplots and histograms).

Figur 10: Studentized residuals from the oneway ANOVA type mixed model analysis.

15

Page 16: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Note that a large studentized residual (either positive or negative) indicates that the outcomeis far from the expected mean outcome in the population, while a large scaled residual mayindicate either a deviation from the expected mean outcome in the population or that an outcomeis far from its expected value considering the other outcomes belonging to the particular subjectand the correlation in the data. To identify which subjects the outlying residuals belong to,you can check the output dataset generated with the OUTPUT statement. Note, however, thatthe most extreme outliers should be obvious already in the spaghettiplots which are easier tointerpret since data is shown on its original scale.

Figur 11: Scaled residuals from the oneway ANOVA-type mixed model analysis.

As appears from the plots, the residuals from the CKD study comply well with the normal di-stribution save for a few not all to extreme values. Going back to the spaghettiplot (recall thatwe have restricted the analysis to the control group), we note one person who has a smallerAIX value at baseline compared to the others and one who has a larger value after 12 weekscompared to the others and to himself at the two other occations. If we checked the output datawe would find that these are also the observations giving rise to the most extreme residuals.According to the investigators the outliers are compatable with the natural variation in diseaseprogression and we decide that they do not compromise the validity of the statistical analysissince they are neither erroneous nor extreme to an extent that will seriously influence the sta-tistical results. If natural but more extreme outliers had occured, a possibility would be to dosensitivity analysis including and excluding them to check how results were affected. Erroneousoutcomes, of course, would have to be corrected or deleted.

16

Page 17: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Covariance and correlation matrices: The covariance parameters are usually of secondaryinterest to the mean parameters in linear mixed models analysis. The reasons why we want tocheck on them anyway are:

• To better understand linear mixed models and multivariate normal distributions.

• To use them in power calculations for future studies.

• Implausible values indicate errors in the data or the program.

The estimated covariance parameters and the corresponding correlations from the CKD studycontrol groups are shown below. Note that linear mixed models in general allow for covariancesthat depend on covariates in the model, e.g. two different covariances for two different groups.This is why SAS outputs estimates from a particular subject (by default id=1 which appearsfirst in numerical order). In this case it doesn’t matter, but if the model was more complex youwould have to supply additional subject id’s, e.g. to get the two different correlation matricesfrom the two different groups (see section 2 below).

Figur 12: Estimated covariance and correlation matrix from the oneway ANOVA-type mixedmodel analysis.

As appears the correlation between AIX from neighbouring visits are just below 80% while thecorrelation between the baseline and end point AIX is roughly 75%. The covariance matrix isnot directly interpretable, it is displayed since the covariance parameters are the ones PROCMIXED estimate during the numerical optimisation. However, once we have the variance esti-mates (in the diagonal of the covariance matrix), we can compute the standard deviations:

σ̂1 =√

88.58' 9.41, σ̂2 =√

109.85' 10.48, σ̂3 =√

74.14' 8.61

which describe the variability in the population. Please note that the estimated standard de-viations and correlations are similar but not exactly identical to those we found using PROCCORR. This is due to missing data which is implicitly imputed by PROC MIXED under amissing at random assumption. I will discuss missing data in detail in lecture 6.

Output data with predicted means and residuals: The estimated trend in population meansfrom the CKD study is shown below.

17

Page 18: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 13: Predicted population means from the one-way ANOVA-type mixed model analysis.Dashed lines indicate the 95% confidence intervals.

Recall that to make this plot I used the OUTPUT statement in PROC MIXED to save the pre-dicted means for each combination of covariates in the data. In fact the output dataset (whichI named ckdfit1) contains a bit more which may sometimes be useful, e.g. the confidenceintervals for the predicted means and various kinds of residuals when requested. Run the demoand look inside the output data to see exactly what it contains.

2. Analysis of parallel group studies

In a parallel group study two homogeneous populations are followed over time and the researchinterest is to compare systematic changes in the outcome between the groups. From a statisticalpoint of view this means that we wish to compare population means between different groupsand time points while acknowledging the correlation in the repeated measurements on the thesame subject.

Here I will illustrate the analysis using data from the CKD study pretending that this was anobservational study. That is, we pretend that treatments weren’t randomized. This implies thatthe two patient groups might differ substantially already at baseline and as part of the analysiswe will estimate the difference between the two population means at baseline as well as thedifference in changes in means over time between the groups.

18

Page 19: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Occation Population mean with standard treatment Population mean with Eplerenoneweek=0 µ1 = β0 µ4 = β0 +β1week=12 µ2 = β0 +β2 µ5 = β0 +β1 +β2 +β4week=24 µ3 = β0 +β3 µ6 = β0 +β1 +β3 +β5

Tabel 2: Population means (µ) over time in assumed non-randomized treatment groups witheither standard treatment or eplerenone. Differences in means, changes over time, and differen-ces in changes over time are described by the regresssion parameters β1 – β5 with the baselinemean in the population receiving standard treatment is the intercept (β0).

To perform the analysis we specify a linear mixed model with group (treatgroup in theCKD study) and occation (week in the CKD study) as categorical covariates like in a twowayANOVA model. Please note that we are particularly interested in the group-occation intera-ction (treatgroup*week) as this reflects a potential difference in time evolution betweenthe groups. To account for the correlation in the data as well as possible changes in varian-ces/standard deviations over time we specify an unstructured covariance pattern.

SAS program

The program for analyzing parallel group studies differs from that used to analyze single groupstudies in two regards:

• Both group (treatgroup) and time (week) must be declared as covariates in theCLASS statement. Use REF to specify which is the reference group.

• Both group (treatgroup), time (week), and their interaction (treatgroup*week)enter as covariates in the MODEL statement.

Besides this the SAS program is similar. I refer to section 1 on single group studies for furtherexplanation of both the code and the output.

PROC MIXED DATA = ckdlong PLOTS = ALL;CLASS id week (REF=’0’) treatgroup (REF=’0’);MODEL aix = week treatgroup week*treatgroup

/ SOLUTION CL DDFM = KR VCIRY OUTPM=ckdfit2;REPEATED week / SUBJECT = id TYPE = UN R RCORR;RUN;

Note that I have included the following non-essential but useful options:

• PLOTS=ALL and VCIRY to produce residual plots

• OUTPM to save predicted population means in an output dataset,

• R RCORR to output the estimated covariance and correlation matrices.

19

Page 20: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

To make a plot comparing the predicted population means between the two groups use:

PROC SORT DATA=ckdfit2;BY treatgroup week id;RUN;

PROC SGPLOT DATA=ckdfit2;SERIES X=week Y=pred / GROUP=treatgroup MARKERS;RUN;

A note on differences in covariances between groups

In a parallel group study it is possible that the groups differ not only in terms of their means butalso in terms of their variances and/or correlations. This for instance would be the case whencomparing the heterogeneous outcomes in a patient group to a more homogeneous healthy con-trol group (or the other way around).

In case differences in variability/correlation are expected it is more pertinent to specify a mixedmodel with different covariance parameters for the two groups (although this comes at the priceof increased model complexity; double up on the number of covariance parameters). To do thisyou would have to change the REPEATED statement in PROC MIXED to:

REPEATED week / SUBJECT = id TYPE = UN GROUP=treatgroup;

I omit the output from this model for the sake of a shorter introduction to PROC MIXED.

An note on confounders and other covariates

If differences between parallel groups are found, one would very often be interested in whetherthese persisted when controlling for potential confounders. E.g., still pretending that the CKDstudy wasn’t randomized, we could add age and gender as explanatory variables to the linearmixed model by changing the MODEL statement to:

MODEL aix = sex age week treatgroup week*treatgroup/ SOLUTION CL DDFM = KR VCIRY OUTPM=ckdfit2;

Don’t forget that sex must also be declared in the CLASS statement since it is a categoricalcovariate. Again for the sake of a short introduction I am omitting the output from this analysis.However, if you plan to apply a similar analysis to your own data, please pay attention to themodel fit. When adding more covariates to the linear mixed model you should worry whetherthe model is well specified just as you would with an ordinary linear model, i.e. that the effectof the continuous covariate age is linear (plot the residuals in the output dataset against age tocheck) and that no substantial interactions between the covariates have been neglected. Finally,it should be noted that timevarying confounders in longitudinal studies must be handled withgreat care to avoid bias. I recommend you consult with a statistician about this matter.

20

Page 21: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

The most important parts of the output

Model specification and convergence: At first I make fast check of the technical summaryfrom PROC MIXED. Just as I did with the single group study.

Figur 14: Technical summary of the twoway ANOVA-type mixed model analysis.

It seems that I managed to apply the intended mixed model with the unstructured covarianceto the right outcome in the right dataset. Moreover I can see that I remenbered to specify id,week, and treatgroup as categorical variables. I also remembered to include the DDFM=KRoption which applies the Kenward-Roger correction to the degrees of fredom thereby improvingthe validity of my tests. As to the 9 observations not used by PROC MIXED these correspondto the 9 missing values of AIX in the data. Last but not least, I check that the numerical optimi-sation has converged, which is has, so I can proceed to interpreting the results of the analysis.

Estimates and confidence intervals: The treatgroup effect in the twoway ANOVA typemodel describes the difference between the two patient groups at baseline (which is referencepoint for week). The week effect in the twoway ANOVA type model describes the changessince baseline in the standard treatment group (which is reference point for treatgroup).And finally the interaction effect describes the difference in changes since baseline between theEplerenone and the standard treatment group (the differences of the differences).

21

Page 22: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 15: Estimates from the twoway ANOVA-type mixed model analysis.

As appears mean AIX is somewhat smaller in the Eplerenone group at baseline, but the dif-ference is not significant (non-surprisingly as groups were in fact randomized, but we are stillpretending they aren’t). We note a non-significant increase in mean AIX from baseline to 12weeks in the standard treatment group, and a significant one from baseline to 24 weeks. Theestimated interaction terms tells us that mean AIX changed substantially less in the Eplerenonegroup over time. In fact, when adding up the numbers, we can tell that mean AIX decreasedslightly from baseline to 12 and 24 weeks, repectively. However, the mean changes over timedo not differ significantly between the groups.

To conclude:Patients who received Eplerenone on average had a seemingly better outcome already at base-line and tended to improve slightly with time in contraty to patients on standard treatment whoexperienced a worsening in AIX over time. Still, no significant differences were found betweenthe groups. Larger studies are needed to reach certain conclusions.

Please note that we have to be careful not to base too strong conclusions on the tests sincethe study was underpowered and confidence intervals are overall wide . . .

It would be nice to have estimates and confidence intervals also for the changes over time withinthe Eplerenone group. Although they are not in this output, we could easily get them by chan-ging the reference point for treatgroup to REF=’1’ in the code (or by using the alternativecode with the LSMEANS statement in the demo program file).

Type 3 tests: If you’d rather test the hypothesis H0 : No intercation, i.e. that changes in me-ans over time are similar between the groups, the type 3 test shows a non-significant p-value:

Figur 16: Type 3 tests from the twoway ANOVA-type mixed model analysis.

22

Page 23: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

This implies that, in principle, you could delete the interaction from the MODEL statement andproceed to test the main effects. However, since the interest of the study was to describe thepotentially different time evolutions in the two groups, I would rather report the non-significantdifferences with confidence intervals.

Additional interesting output

Residual plots: Like in the analysis of the single group study, we inspect the residualplots ofthe studentized and the scaled residuals to judge the validity of the modeling assumptions andour statistical results.

Figur 17: Studentized residuals from the twoway ANOVA type mixed model analysis.

Compared to the analysis of the control group alone, more negative studentized residuals appearin the plots but otherwise the residuals comply well with the normal distribution. We identifyall but two of the outlying residuals with data from two persons in the Eplerenone group whohad small augmentation indices already at baseline. These patients might be somewhat atypicalbut since the fulfilled the inclusion criteria, they should not be deleted from the analysis. If asignificant difference had occured at baseline, we might have performed a sensitivity analysisto check that the result did not rely solely on these two atypical patients.

When considering the scaled residuals the outliers are no longer that prominent, which makessense since the two persons who started out on the low side are likely to stay on the low sidedue to the correlation in the data (either one of the three values are likely given the two others).

23

Page 24: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 18: Scaled residuals from the twoway ANOVA-type mixed model analysis.

Figur 19: Predicted population means from the twoway ANOVA-type mixed model analysis.

Output data with predicted means and residuals: Finally, I have made a plot showing theestimated trend in population means from the two groups. This I use as a visual aid wheninterpreting the estimates from the analysis.

24

Page 25: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

3. Analysis of randomized group studies

In a randomized group study several random samples are initially drawn from a single ho-mogeneous population. After application of different treatments their outcomes are collectedover time. Most randomized studies further include a baseline measurement which contains theoutcome prior to initiation of treatment. The research interest in such a study is to comparesystematic changes in the outcome between the treatments as any signficant difference foundwill be evidence of a difference in treatment effects (causal ones due to the randomization).Note that if no baseline measurement is collected, we cannot evaluate changes since baselineand analysis will proceed like a parallel group study (since the outcomes may differ betweenthe groups already at the first occation due to the different treatments).

From a statistical point of view we again wish to compare population means between differentgroups and time points while acknowledging the correlation in the repeated measurements onthe the same subject.

Here I will illustrate the analysis using data from the CKD study. As treatments were rando-mized, this is the proper and statistically optimal analysis from which we would want to publishthe results. The constrained linear mixed model for randomized studies only differs from thetwoway ANOVA type model for parallel groups studies in one aspect: It only needs one para-meter to describe the population means at baseline (since all random samples are drawn fromthe same population they must share the same true population mean).

Occation Population mean with standard treatment Population mean with Eplerenoneweek=0 µ1 = β0week=12 µ2 = β0 +β1 µ4 = β0 +β1 +β3week=24 µ3 = β0 +β2 µ5 = β0 +β2 +β4

Tabel 3: Population means (µ) over time in assumed randomized treatment groups with eitherstandard treatment or eplerenone. Differences in means, changes over time, and differences inchanges over time are described by the regresssion parameters β1 – β4 with the baseline meanin the patient population as intercept (β0).

To perform the constrained analysis a couple of computational tricks are needed. First we haveto add a new variable to the data (in the long format), one which contains the de facto treatmentreceived by each patient at the separate occations. At all other occations than baseline this willbe identical to the old variable containing the treatment groups, while at baseline this must beset to the value of the control treatment for all subjects. To add the new variable in SAS use:

DATA ckdlong;SET ckdlong;treatment = treatgroup;IF week = 0 THEN treatment = 0;RUN;

After adding the new treatment variable, the long data from id=1 and id=3 looks like this.Please note the difference between the two treatment varables!

25

Page 26: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

id week sex age treatgroup treatment aix1 0 1 57 0 0 10.51 12 1 57 0 0 17.51 24 1 57 0 0 25.03 0 2 54 1 0 183 12 2 54 1 1 243 24 2 54 1 1 23.5

Next we have to run the constrained linear mixed model analysis in PROC MIXED using thenovel treatment varaible we have created in place of the old. To account for the correlation inthe data as well as possible changes in variance/standard deviation over time we specify anunstructured covariance pattern.

SAS program

The program for analyzing randomized group studies differs from that used to analyze parallelgroup studies in two regards:

• The new variable (treatment) is used in place of the old (treatgroup).

• The time-variable (week), and the interaction term (treatment*week) enter as cova-riates in the MODEL statement, but the main term treatment must be omitted.

Besides this the SAS code is similar to that for the single and parallel group studies. I refer tosections 1 and 2 for further explanation.

PROC MIXED DATA = ckdlong PLOTS = ALL;CLASS id week (REF=’0’) treatment (REF=’0’);MODEL aix = week week*treatment

/ SOLUTION CL DDFM = KR VCIRY OUTPM=ckdfit3;REPEATED week / SUBJECT = id TYPE = UN R RCORR;RUN;

I have added options to the program to make residual plots, to save the predicted populationmeans in an output dataset, and to output the estimated covariance and correlation matrices.

To make a plot comparing the predicted population means between the groups I use the fol-lowing code. Please note that the old treatgroup-variable is used to make the plot.

PROC SORT DATA=ckdfit3;BY treatgroup week id;RUN;

PROC SGPLOT DATA=ckdfit3;SERIES X=week Y=pred / GROUP=treatgroup MARKERS;RUN;

26

Page 27: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

The most important parts of the output

Model specification and convergence: At first I make fast check of the technical summaryfrom PROC MIXED. It seems that I managed to apply the intended mixed model with theunstructured covariance to the right outcome in the right dataset. Moreover I can see that Iremenbered to specify id, week, and treatment as categorical variables. I also rememberedto include the DDFM=KR option which applies the Kenward-Roger correction to the degrees offredom thereby improving the validity of my tests. As to the 9 observations not used by PROCMIXED these correspond to the 9 missing values of AIX in the data. Last but not least, I checkthat the numerical optimisation has converged, which is has, so I can proceed to interpreting theresults of the analysis.

Figur 20: Technical summary of the twoway ANOVA-type mixed model analysis.

Estimates and confidence intervals: The week effect in the contrained linear mixed modeldescribes the mean expected changes after initiation of standard treatment (which is referen-ce point for treatment. The interaction terms describes the expected differences in changessince baseline between the eplerenone and the standard treatment (the differences of the dif-ferences). Note that compared to the twoway ANOVA type model there is no main term fortreatment. We know that any differences between the groups at baseline are solely due torandom sampling. Hence, we do not wish to estimate the true differences between the popula-tion means at baseline since we know it is zero.

We note a non-significant increase in mean AIX from baseline to 12 weeks in the standard tre-atment group, and a significant one from baseline to 24 weeks. The estimated interaction termstells us that mean AIX changed substantially less in the Eplerenone group over time. In fact,

27

Page 28: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 21: Estimates from the one-way ANOVA-type mixed model analysis.

when adding up the numbers, we can tell that mean AIX decreased slightly from baseline to 12and 24 weeks, repectively. The mean changes over time differ just significantly between the twotreatments at final follow-up with a p-value of 4.94%.

To conclude:A significant difference in treatment effect was found in favour of Eplerenone (P=0.049). Pa-tients who received Eplerenone on average had a seemingly better outcome and tended to im-prove slightly with time in contrary to patients on standard treatment who had experienced aworsening in AIX at final follow-up. However, the confidence interval for the difference betwe-en the treatments is wide and larger studies are needed to reach a certain conclusion about thesuperiority of Eplerenone.

Note that, even though the higher power of the constrained linear mixed model flips the p-value in favour of Eplerenone, we still have to be careful not to base too strong conclusions onthe tests since the study was underpowered and confidence intervals are overall wide. . . .

It would be nice to have estimates and confidence intervals also for the changes over time withinthe Eplerenone group. Although they are not in this output, we could easily get them by chan-ging the reference point for treatment to REF=’1’ in the code (or by using the alternativecode with the LSMEANS statement in the demo program file).

Type 3 tests: If you’d rather test the hypothesis H0 : No intercation, i.e. that changes in me-ans over time are similar between the treatments at all occations, then look at the output fromthe type 3 tests:

Figur 22: Type 3 tests from the constrained linear mixed model analysis.

Since the presumed beneficial effect of Eplerenon was not expected to show untill after the full

28

Page 29: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

24 weeks of treatment, it is not surprising that this less powerful test come out with a p-valuethat is larger than the one we get from evaluating the treatment at final follow-up.

Additional interesting output

Residual plots: Like in the analysis of the single and parallel group study, we inspect theresidualplots of the studentized and the scaled residuals to judge the validity of the modelingassumptions and our statistical results.

Figur 23: Studentized residuals from the constrained linear mixed model analysis.

Appearantly the residualplots are almost identical to the ones we found in the analysis of thetwoway ANOVA type model for parallel group studies. This is not all to surprising since thetwo models are identical in all but one regards and since they are applied to the exact same data.The most outlying residuals belong to the same subjects that we have previously considered andfor the same reasons. Hence, I refer to sections 1 and 2 for further explanation.

Output data with predicted means and residuals: Finally, I have made a plot showing theestimated trend in population means from the two treatment groups. From this the differencebetween the twoway ANOVA type linear mixed model for parallel group studies and the con-strained linear mixed model for randomized groups studies should be obvious. Compared withthe similar figur in section 2 the two curves now start out in the same point. This confirms thatI have managed to specify the constrained model correctly in SAS.

29

Page 30: Analyzing baseline follow-up studies with SAS PROC MIXEDpublicifsv.sund.ku.dk/~jufo/courses/rm2019/ckd_demo_sas.pdf · in the power calculation, the study was de facto underpowered

Figur 24: Scaled residuals from the constrained linear mixed model analysis.

Figur 25: Predicted population means from the constrined linear mixed model analysis.

30