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.
Since it is your dependent variable is binary, ANOVA is not appropriate.
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.
OK,
Can you tell me what steps I need to take to transfer a binary distribution to a normal distribution?
-Luke.
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.
If I use logistic regression my results will be valid?
Does that apply to the homogeneity of variance as well?
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.
I'm doing an ANOVA.
Since it is your dependent variable is binary, ANOVA is not appropriate.
Got it. Thanks.
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.