Programming the statistical procedures from SAS

Binary Data

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Binary Data

I am running statistics on survival of planted tree seedlings using SAS 9.3. Each seedling received a 1 for alive or a 0 for dead. Because I'm using binary data, I don't have a normal distribution. I want to use proc glimmix to transform my distribution.

 

This is what I entered in the editor:

data rcb;
infile 'F:\RC_2016\Field_Study_Data.csv' DLM=',' DSD MISSOVER firstobs=2;
input site $ mulch herb  species $ seedling  Alive n;
run;
proc print data=rcb;
run;

proc glimmix data=rcb ;
class site species mulch herb seedling ;
model Alive (event='1') = mulch herb species mulch*herb mulch*species herb*species mulch*herb*species/s
dist=binary link=logit;
random  site site*mulch site*herb site*species site*mulch*herb site*mulch*species site*herb*species /s;
run;

 

When I use univariate to look at normality and my distribution, it has not changed. What am I missing?

 

Thanks for your time,

Luke.


Accepted Solutions
Solution
‎02-02-2016 07:14 AM
Frequent Contributor
Posts: 140

Re: Binary Data

Since it is your dependent variable is binary, ANOVA is not appropriate.

View solution in original post


All Replies
Frequent Contributor
Posts: 140

Re: Binary Data

PROC GLIMMIX does not transform the data, it lets you analyze it as is. This is similar to PROC LOGISTIC, only GLIMMIX lets you include data that is not independent.

Occasional Contributor
Posts: 5

Re: Binary Data

OK,

 

Can you tell me what steps I need to take to transfer a binary distribution to a normal distribution?

 

-Luke.

Frequent Contributor
Posts: 140

Re: Binary Data

There is no way to transform binary data to normal data. That's one reason you need logistic regression.

 

Binary data can only take two values.  Normal data is continuous.

Occasional Contributor
Posts: 5

Re: Binary Data

If I use logistic regression my results will be valid?

 

Does that apply to the homogeneity of variance as well?

Frequent Contributor
Posts: 140

Re: Binary Data

This isn't really the forum for teaching all about logistic regression.  Entire books have been written about it. You need to learn how to do it, how to interpret the results and so on. You could start with the documentation for PROC LOGISTIC; there are also papers on this from various RUGs, SGF and SUGIs (including a couple by me) but you probably need a good book or else to hire a consultant.

Grand Advisor
Posts: 16,926

Re: Binary Data

What type of analysis are you doing that requires normality? Always go back to your base assumptions.
Occasional Contributor
Posts: 5

Re: Binary Data

I'm doing an ANOVA.

Solution
‎02-02-2016 07:14 AM
Frequent Contributor
Posts: 140

Re: Binary Data

Since it is your dependent variable is binary, ANOVA is not appropriate.

Occasional Contributor
Posts: 5

Re: Binary Data

Got it. Thanks.

Respected Advisor
Posts: 2,655

Re: Binary Data

Luke, 

 

Try adding an lsmeans statement to your model, to see if you get proportions out that you can understand.  Also, using by subject processing can greatly improve your chances of convergence.  I have rewritten your random statement to take advantage of this.

proc glimmix data=rcb ;
class site species mulch herb seedling ;
model Alive (event='1') = mulch herb species mulch*herb mulch*species herb*species mulch*herb*species/s
dist=binary link=logit;
random  intercept mulch herb species mulch*herb mulch*species herb*species /subject=site s;
lsmeans mulch|herb|species/diff ilink; run;

Now, i would also suggest that perhaps your random statement probably overspecifies the number of random effects.  You could probably get by with:

 

random intercept/subject=site;

 

Also, you should consider some points brought out by Walt Stroup in his book Generalized Linear Mixed Models (get a copy)--that the estimates and tests from this method tend to be biased, and that you may want to consider adding METHOD=LAPLACE to the PROC GLIMMIX statement.

 

Steve Denham

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 496 views
  • 4 likes
  • 4 in conversation