Hi,
I am trying to do ANCOVA using the SAS studio for three categories based on data. Please may i know how can i use 3 categorical variables at the same time? My collaborators used the same data and used the SAS enterprise guide (which i don't have) and used 3 variables together. using 1 variable is not helping me to reproduce similar results. I need to reproduce the same results for further analysis.
Here i have attached the data and results from SAS enterprise guide,
In the data zero (o) means "without diet", and one (1) means "with diet".
Please help me, Thanks,
Khem
We really would benefit from seeing the code used by your collaborators. Neverthess, this code should produce an ANCOVA with 3 categorical variables (which I have named CAT1 CAT2 and CAT3) and one covariate (which I have named X)
proc glm data=have;
class cat1 cat2 cat3;
model y = x cat1 cat2 cat3;
run;
quit;
Hi @PaigeMiller Thanks for the quick response,
I ran again with your suggested code,
I could up to typeIII values and F values, this is great, Exact same like my collaborator,
I attached my results too (SAS_studio...pdf)
But i am not able to get the estimate and t and Pr>t values (please check the attached file [ancova_cassie...] for results from a collaborator) like my collaborators had,
Please can you help me on this too,
They used SAS enterprise guide, so i am not sure, if they will have codes for them,
Thanks,
Khem
Generally, I do not download attachments. Please post the relevant information as a screen capture in your message.
Hi @PaigeMiller ,
Okay,
Here i dropped the screen images for the results of my collaborator (first one with blue font) and mine (image with black&white font). My results are based on your previous suggestion. I got similar values for TypeIII and Pr>F like my collaborator, which is great. Your suggestion is in the perfect and right direction for my data. Please kindly suggest me how can I get similar intercept and Pr>t values too? for the reference, I also put the image of my datasheet.
Note: Here In the data zero (o) means "without diet", and one (1) means "with diet"
Thanks,
Khem
I don't see any similarity. It doesn't even look like you have the same data or the same response variable.
Hi @PaigeMiller
I am really sorry,
I uploaded the wrong file of my collaborator,
Here i attached the right file of my collaborator, along with my same results (after your suggestion, black&whilte figure) and data from my previous post,
Here I got similar values for TypeIII and Pr>F like my collaborator, now i need to get same intercept, estimates, Pr>t values.
Sorry again,
Khem
You don't show the intercept or estimates for the 2nd analysis.
Hi @PaigeMiller ,
Second analysis i did, based on your first suggestion but when i ran your equation in SAS studio, I didn't get the intercept, estimates and Pr>t values.
do i need to add something into your previous equation?
Thanks,
Khem
oh, I understand now, that was my omission. Use this MODEL statement with the SOLUTION option
model y = x cat1 cat2 cat3/solution;
Hi @PaigeMiller
Thanks for the suggestion, it worked,
Here is the image
I got the same estimate and Pr>t values for all three diets,
Only one doubt, the estimate of intercept is not matching,
My collaborator had 1.26 (in previous post figure) but mine is 2.60. Does it matter? do i need to make any changes?
Thanks again,
Khem
That's very odd, and I don't have an explanation about how everything can be the same except the intercept.
Oh,
Here i attached my codes, if it may help you,
Thanks,
Khem
Hi @PaigeMiller ,
Sorry to bother you again,
is it possible to reproduce your model for ANCOVA in R?
If yes, can you suggest to me how? what should i add for solution (SAS studio) option in R?
Thanks,
Khem
You need to ask your question in an R forum and not in a SAS forum.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.