CHAPTER 7 (SAS Session) 2023

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 137

CHAPTER SEVEN

Statistical Data Analysis Using SAS

Haramaya University

College of Computing and Informatics

Department of Statistics
Set by Kindu Kebede

Email; m7.kebede @gmail.com;k7.kebede@gmail.com;

JUNE, 2023
Advanced Statistics Using SAS
Overview of SAS
What is SAS?
• Began as a statistical package
• Also allows users to:
– Store data
– Manipulate data
– Create reports
• PDF
• Excel
• HTML
• XML
• RTF / Word
• Etc. Etc. Etc.
What is SAS?
• Also allows users to:
– Create graphs
– Create maps
– Send e-mails
– Create web applications
– Create iPhone Apps
– Access R
– Schedule regularly run reports
– Etc. Etc. Etc.
Overview …

7
Opening SAS
Log:
Details about jobs you’ve run,
including error messages
Explorer Window:
See libraries and
SAS datasets

Enhanced Editor:
Where you write your SAS code
Enhanced Editor Window

11
Cont….

12
THE LOG Window

13
THE LOG Window

14
The Output Window
Results tab:
List of previously
run results Output Window:
Basic view of results and output
(Also known as “Listing
Destination”)
Explorer Window

Explorer
Window
Results Window
Cont…
Cont…
Data Value, Variable, Observation, and Data Set
Rules for Naming Variables in SAS

24
Rules for SAS Statements
Cont..
Getting Data into SAS
Cont…
DATA steps:
Read and write data, manipulate data,
perform calculations, etc.

Every DATA step creates a new dataset


Reading Data from Diferent Sources
Writing an Input Statement
Using a CARDS or DATALINES Statement
The SAS PROC Step
Every SAS
program can
have multiple
DATA and PROC
steps

PROC steps:
Produce reports, summarize data, sort data,
create formats, generate graphs, etc. etc. etc.
PROC step examples
PROC step examples

PROC freq
 Creates a basic frequency
table with:
 Frequency
 Percent
 Cumulative Frequency
 Cumulative Percent
 “DATA=newdemo”
references the newdemo
dataset
 TABLE statement indicates
which variable(s) to include
 Can use multiple variables
and even create cross-tab tables
PROC step examples

PROC means
 Creates a basic summary
table with:
N
 Mean
 Std Dev
 Minimum
 Maximum
 Can specify which statistics
to use in table
 “DATA=newdemo”
references the newdemo
dataset
 VAR statement indicates
which variable(s) to include
Other notes

Step boundaries:
Each step is executed when a step
boundary is encountered

Explicit step boundary: RUN or QUIT


statement

Implicit step boundary: Beginning of a new


PROC or DATA step
Good SAS
programmers
use EXPLICIT
step
boundaries
Cont…
PROC Syntax Commonalities
Submitting a Program in SAS
You can submit the
program as a whole
or

Run only a portion of


highlighted code
Chunks of code will be
processed in the order you
RUN them, not necessarily
in the order you wrote
them
Run:
Submits your SAS code
(“The Running Man”)
Commenting Out SAS Commands
Comment statements:
Ignored by SAS when code is run

Used to write comments to yourself or others


or
comment out code you don’t want to run

*comment statement;
or
/* comment statement */
Examining the Results
SAS Help
Where to learn more about SAS
 Technical papers
 SAS User Groups

 Websites

 Books

 Classes

http://www.sascommunity.org/wiki/
Learning_SAS_-_Resources_You_Can’t_Live_Without
www.google.com
www.ats.ucla.edu/stat/sas
www.lexjansen.com
SAS Help and Documentation
Correcting SAS Errors
Data Management using SAS
Sorting Data
Questions?
Introduction on Variable Descriptive Data Analysis Inferential Data Analysis

Statistical Data Analysis and Modeling Using


SAS

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Descriptive Analysis of Categorical Data

Categorical data can be described using count values, percentages


or using different diagrammatic ways

Generally, it is known to be frequency analysis

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Descriptive Analysis Quantitative Data

Quantitative data can be described using different measures of


locations and measures of variation

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Graphics for Quantitative Data Cot...


Here are some functions for the graphics of quantitative data
Proc SGPLOT data=ED3;
scatter X=weight Y=CD4;
TITLE "SCATTER PLOT OF WEIGHT AND CD4";
RUN; ###########################OR
Proc SGPLOT data=ED3;
scatter X=weight Y=CD4/FILLEDOUTLINEDMARKERS
MARKERATTRS=(SYMBOL=DIAMOND);
TITLE "SCATTER PLOT OF WEIGHT AND CD4";
RUN; ##############################3OR
*CHANGE COLOR;
Proc SGPLOT data=ED3;
scatter X=weight Y=CD4/FILLEDOUTLINEDMARKERS
MARKERATTRS=(SYMBOL=DIAMOND)
MARKERFILLATTRS=(COLOR=DODGEBLUE)
MARKEROUTLINEATTRS=(COLOR=DODGEBLUE);
TITLE "SCATTER PLOT OF WEIGHT AND CD4";
RUN; #for Scatter plot of variable
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Graphics for Quantitative Data Cot...

*Add regression Line;


Proc SGPLOT data=ED3;
REG X=weight Y=CD4/FILLEDOUTLINEDMARKERS
MARKERATTRS=(SYMBOL=DIAMOND)
MARKERFILLATTRS=(COLOR=DODGEBLUE)
MARKEROUTLINEATTRS=(COLOR=DODGEBLUE);
TITLE "SCATTER PLOT OF WEIGHT AND CD4";
RUN;

#for Scatter plot of variable

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Graphics for Quantitative Data Cot...


proc univariate data=ch plot normal ;
var Weight;
histogram Weight/normal;
run; #for histogram plots variable
proc sgplot data=ch;
title "Weight Distribution by Breed";
hbox Weight/category=Breed;
run;
# for Box-and-whiskers plot of variable
proc univariate data=ch plot normal ;
var Weight;
qqplot Weight;
run;

#for QQ plot of variable


Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Statistical Model

Statistical Model: is a simplifted, mathematically-formalized


way to approximate reality and to make predictions from this
approximation based on observed data.

Example:we are interested to represent the height of plants


according to soil water content and other environmental factors
after an experiment on a sample of plants submitted to growing
soil humidity and other environmental factors using Statistical
model

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Variable and Statistical Model

Statistical models imply explanatory and dependent


variables

Dependent variable:Is the one we want to describe, to


explain or to predict

Explanatory variables:Referred to as independent variables,


are the ones we use to explain, to describe or to predict the
dependent variable(s).

Type of variable we have determine the type of model we ftt

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Variable and Statistical Model Cont...

Response continuous:Regression, ANOVA

Response

categories:logit,probit,MLR,OLR

Response Count:Log linear models

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Steps in Statistical Modeling

 Problem identiftcation and speciftcation

 Purpose of the study

 Variables of the study

 Study design and data

 Data collection

 Model formulation and assumption

 Model fitting to data


 Model diagnosis
 Interpretation
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Hypothesis Testing
Hypothesis:Is an assertion about a given population
parameter

It can be rejected or not based on observed values (Test


Statistic)

H0 : There is no difference is no signiftcance difference in


specifted populations Versus HA : not H0

Type I or type II error can be committed while hypothesis


testing

Type I error happens when true null is rejected whereas type


II
error happens when we fail reject the false null
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Hypothesis Testing Cont...

The null hypothesis can also be rejected or fail to be rejected by


comparing α (Level of signiftcance) and P-value

P-value:Is the probability of observing larger test statistic in the


direction of HA

Level of signiftcance α:Is probability of committing type one


error

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Chi-square With SAS

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Chi-square With SAS Cont...

Exercise:Consider ed3.csv data and test association between


Status and clinical stage(clincs),Status and residence(residens)
and Status and marital status(Status) of the patients

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

One Sample t- test With SAS

The command used to do t-test is: PROC TTEST DATA=DATA


NAME H0=MU SIDES=L OR G ALPHA=LEVEL OF ALPHA;
VAR vARNAME;
RUN;

Example: A bottle filling machine is set to fill bottles with soft


drink to a volume of 500 ml.The actual volume is known to
follow a normal distribution. The manufacturer believes the
machine is under-filling bottles. Test the claim of
manufacturer based on taken 20 samples(volume.csv data
set)

Kindu.k Statistical Models and Analysis Using R


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

One Sample t- test with SAS Cont...

EXAMPLE 1: ONE-SAMPLE T-TEST USING VOLUME DATA

PROC TTEST DATA=VOLUME H0=500 SIDES=L ALPHA=0.05;


VAR volume;
RUN;
##########Confidence Interval######
proc means data= volume lclm uclm alpha= 0.05;
var volume;
run;

Exercise: Consider infant.csv data from your file and test


whether the mean of infants is greater than 65cm at age of 12
months.
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Independent Samples t-test With SAS

PROC TTEST DATA=Data name H0=null hypothesis


SIDES= alternative Hypothesis ALPHA=level of
alpha;
class Group variable;
VAR numeric variable ;
RUN;
Where; response is a numeric variable in given data values
and treat a factor with two levels giving the corresponding
groups and the rest is same to the previous one

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Example With SAS


Consider infant.csv data and test equality of mean height
of infant by breast feeding at age of 12 months
PROC TTEST DATA=infant H0=0 SIDES=L
ALPHA=0.05;
class BF;
VAR HEIGHT ;
RUN;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Example With SAS

Exercise: Test the equality of the height(HEIGHT) of


infants(infant.csv data set) at the age of 12 months by their
vaccination status(VACCIN)

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Paired Samples t-test With SAS

* Paired T-TEST;
PROC TTEST DATA=data name;
paired pre*post;
RUN;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Example Paired Samples t-test With SAS

Example: Suppose a sample of 20 students were given a


diagnostic test before studying a particular module and then
again after completing the module.Then, ftnd out if, in
general,the teaching leads to improvements in students
knowledge or skills (module.csv data set)
* Paired T-TEST;
PROC TTEST DATA=modulet;
paired pre*post;
RUN;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential ANOVA ModelsLinear Regression Model and Correlatio

Paired-Samples t-test With SAS Cont...

Exercise:A clinic provides a program to help their clients lose


weight and asks a consumer agency to investigate the
effectiveness of the program. The agency takes a sample of 15
people, weighing each person in the sample before the program
begins and 3 months later to produce weight.csv data set.

Determine whether the program is effective.

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

One-Way ANOVA With SAS

Analysis of variance using PROC ANOVA;


proc anova data= DATA NAME;
class CATEGORICAL VAR;
model NUMERIC VAR= CATEGORICAL VAR;
means CATEGORICAL VAR/MULTIPLE COMPARITION
METHOD;
run;
is the main function

Example: The Chickens.csv data set contains the weights of 20


chickens with their Breed having four levels: a, b, c and d. The
main problem here is to compare average weight of chickens
with their breed type.
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Reading Chickens data


*Analysis of variance using PROC ANOVA;

proc anova data=Chicken;


class breed;
model weight=breed;
run;
*Analysis of variance and Multiple Comparison
using PROC ANOVA;
proc anova data=Chicken;
class breed;
model weight=breed;
means breed/tukey;
run;
Kindu.k Statistical Models and Analysis Using SAS
Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

chickenData Cont...

proc anova data=chicken ;


class breed;
model weight=breed;
means breed/ tukey bon duncan; *we can use any of
one test;
run;

To fit one way ANOVA Model we consider weight as dependent


variable and Breed is independent variable

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

One Way ANOVA Cont..

Exercise:Consider the Mastitis.csv data set from your file


containing data on the reduction in milk yield in 12 cows
experimentally infected with E. coli and treated with two
factors that is Parity having 2 levels: heifer and multiparous
and Dose having 3 levels: high, medium and low where as
reduction is the response. Compare the reduction in milk yield
by Dose

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Examples on Two-way ANOVA with SAS

We follow the same command with different formula to fit the


model as that of one way ANOVA

Example: Consider Trypanosomosis.txt data set from your file


which contains Packed Cell Volume (PCV) measurements of
12 bovines where the response is the difference between
PCV_after and PC_Vbefore with two factors which are Breed
having 2 levels: Boran and Holstein and Drug also having 2
levels: Berenil and Samorin with the main aim of comparing
PVC difference due to factor effects

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Examples on Two way ANOVA with SAS Cont...

We will read the data from Trypanosomosis.txt into object trypData


*Two way Analysis of variance using PROC ANOVA;
proc anova data=Trypano ;
class breed Drug;
model PCV_before=breed Drug breed*Drug;
means breed Drug breed*Drug/ tukey bon duncan;
*we can use any of one test;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Two Way ANOVA With SAS Cont...

Exercise:Consider the Mastitis.csv data set from your file


containing data on the reduction in milk yield in 12 cows
experimentally infected with E. coli and treated with two
factors that is Parity having 2 levels: heifer and
multiparous and Dose having 3 levels: high, medium and
low where as reduction is the response.

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

RCBD with SAS Cont...

Example:
data corn;
input yield fert field @@;
cards;
28 1 1 34 1 1 32 1 2 33 1 2 30 1 3 33 1 3
40 2 1 38 2 1 39 2 2 44 2 2 36 2 3 38 2 3
;
run;
proc mixed data=corn;
class fert field;
model yield=fert;
random field;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

GRBD With SAS

Milliken and Johnson (1984) present an example of mixed Analysis of


Variance. Three machines, which are considered as a fixed effect, and
six employees, which are considered a random effect, are studied.
Each employee operates each machine for either one, two, or three
different times. The dependent variable is an overall rating, which
takes into account the number and quality of components produced.
The following statements form the data set and perform a mixed
model analysis of variance by requesting the TEST option in the
RANDOM statement. Note that the machine*person interaction is
declared as a random effect; in general, when an interaction involves a
random effect, it too should be declared as random.

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

GRBD With SAS Cont..


data machine;
input machine person rating @@;
datalines;
1 1 52.0 1 2 51.8 1 2 52.8 1 3 60.0 1 4 51.1 1 4 52.3 1 5 50.9
1 5 51.8 1 5 51.4 1 6 46.4 1 6 44.8 1 6 49.2 2 1 64.0 2 2 59.7
2 2 60.0 2 2 59.0 2 3 68.6 2 3 65.8 2 4 63.2 2 4 62.8 2 4 62.2
2 5 64.8 2 5 65.0 2 6 43.7 2 6 44.2 2 6 43.0 3 1 67.5 3 1 67.2
3 1 66.9 3 2 61.5 3 2 61.7 3 2 62.3 3 3 70.8 3 3 70.6 3 3 71.0
3 4 64.1 3 4 66.2 3 4 64.0 3 5 72.1 3 5 72.0 3 5 71.1 3 6 62.0
3 6 61.4 3 6 60.5
;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

GRBD With SAS Cont..

proc glm data=machine;


class machine person;
model rating=machine person machine*person;
random person machine*person / test;
run;

*The TEST option in the RANDOM statement requests that


PROC GLM determine the appropriate F tests based on
person and machine*person being treated as random
effects.

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

GRBD With SAS Cont..

*Note that you can also use the MIXED procedure to analyze mixed models. The
following statements use PROC MIXED to reproduce the mixed model analysis
of variance. the relevant part of the PROC MIXED results is shown in Output;
proc mixed data=machine method=type3;
class machine person;
model rating = machine;
random person machine*person;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Latin square Design With SAS

ANOVA for Latin Square Treatment Design


Four groups of mice, four days, and four treatments are arranged in a latin
square design. The response is the mean change in blood sugar for 6
animals.

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Latin square Design With SAS


data sugar;
input dAy Group$ Insulin $ Response;
datalines;
1 I B -4.5
1 II D 92.33
1 III C 59.83
1 IV A -45.
2 I C 91.83
2 II A -48.33
2 III D 168.99
2 IV B 89.
3 I D 86.16
3 II B -78.16
3 III A -24.17
3 IV C 101.0
4 I A -.17
4 II C 68.83
4 III B 25.17
4 IV D 177.17
;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Latin square Design With SAS


proc anova;
class day group insulin;
model response= day group insulin;
means day group insulin;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Latin square Design With SAS


EXAMPLE TWO
data sugar2;
set sugar;
if insulin='A' then ins=150;
else if insulin='B' then ins=300;
else if insulin='C' then ins=600;
else if insulin='D' then ins=1200;
run;
proc print;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential Analysis Linear Regression Model and Correlatio

Latin square Design With SAS


EXAMPLE TWO
proc glm;
class day group;
model response= day group ins ins*ins ins*ins*ins;
run;
proc sort out=c;
by ins;
run;

proc means;
by ins;
var response;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA Models tio

Correlation and Covariance Matrix With SAS

Consider pr data set from your file.


# import pr data in to SAS

proc corr data= pr;


var y1 y2 y3 y4 y5 y6 y7 y8;
run;

proc calis data=pr;


mstruct var=y1-y8;*covariance matrix;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA Models tio

Linear Regression With SAS

REG(formula, data,...)is the command used to fit linear


regression

Where; formula
proc reg data=data name;
model dep. var = ind.vars;
run;
data is the place of putting the file name of data used to
fit linear regression

Kindu.k Statistical Models and Analysis Using R


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA Models tio

Fitting LR with SAS

Example: Consider pr data set from your file.

proc reg data=pr;


model y1 = y2-y8;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Binary data Modeling Examples

Example: Consider ftstula.csv data set from your file and fit an
appropriate model for recovery status of the patients on Width of
ftstula(Wof),Length of ftstula(Lof),Bladder size(Bladsize),Place
of delivery(Pod).
# import ftstula.csv data sets

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Binary data Modeling Examples Cont..

proc glimmix data=Fistula;


class lof Wof;
model Censor(event='1') = lof Wof / s
dist=binary;
run;*fits logistic regression;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Count data Modeling Examples

Example: Consider ed3.csv data set from your file and fit an
appropriate for CD4 count of patients on some covariates at
baseline
proc glimmix data=ed3;
CLASS FNS;
model CD4 = FNS AGE / s dist=Poisson;
run;
fit the poisson model for the data

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Multinomial model Cont...

Example: Considering ed3.csv data set fit multinomial


logistic regression of current status of patients on Functional
status(FNS) and age of the patients

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Multinomial model Cont...

proc genmod data=ed3;


class FNS;
model Status = FNS AGE / dist=multinomial
aggregate=FNS
type1;
run;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

Ordinal Logistic Regression With R Cont..

Example: Considering ed3.csv data set fit ordinal logistic


regression of current status of patients on Functional
status(FNS) and age of the patients
proc genmod data=ed3 rorder=data;
class FNS;
model Status = FNS AGE / dist=multinomial
link=cumlogit
aggregate=FNS
type1;
estimate 'LogOR12' FNS 1 -1 / exp;
estimate 'LogOR13' FNS 1 0 -1 / exp;
estimate 'LogOR23' FNS 0 1 -1 / exp;
run; *fitted OLR;

Kindu.k Statistical Models and Analysis Using SAS


Introduction on VariableDescriptive Data AnalysisInferential AnalysisANOVA ModelsLinear Regression Model and Correlatio

I THANK YOU FOR YOUR PATIENCE


!!

Kindu.k

You might also like