Hello everyone,
for my study, I need to conduct mixed ANOVA. I have one variable - group with two levels, the second variable - annual interest rate (AIR) which includes time and amount (for small amount 5 time periods and for a high amount 5 time periods).
Variables that I have are:
1.Group (numerical with one or two)
2.AIR_5006m(continous) AIR_500_1year (continous) AIR_500_2years (continous) AIR_500_5years (continous) AIR_500_10years (continous) AIR_200006m (continous) AIR_20000_1year (continous) AIR_20000_2years (continous) AIR_20000_5years (continous) AIR_20000_10years (continous).
I believe that I have interaction between group, amount (500 and 20000) and time (6 months, 1 year, 2 years, 5 years and 10 years). For that purpose, I want to conduct ANOVA to test for the main effects and interaction in SAS.
Could you help me with the code or the idea for mixed ANOVA?
Thank you in advance,
Aleksandar
AIR_5006m | AIR_500_1year | AIR_500_2years | AIR_500_5years | AIR_500_10years | AIR_200006m | AIR_20000_1year | AIR_20000_2years | AIR_20000_5years |
1.00% | 1.00% | 1.01% | 1.02% | 1.05% | 4.01% | 4.03% | 4.03% | 4.03% |
3.00% | 3.92% | 4.03% | 4.01% | 4.01% | 4.01% | 1.05% | 4.03% | 4.01% |
3.96% | 3.92% | 4.03% | 4.01% | 4.01% | 4.03% | 4.01% | 4.03% | 1.05% |
Three-way ANOVA with two variables? Did you leave one out?
Anyway, I don't understand your description of variable 2.
I am not really sure whether I explained in a good way. The group is a variable that takes value 1 or 2. AIR is the variable that is related either to low amounts (500) or high amounts (20000). It is also related to time periods (6 months, 1 year, 2 years, 5 years and 10 years). However, this variable is actually not decomposed (because interest rates are related to amount and time). I expect to have interaction for group, time and amounts. I hope you understood better what I wanted to write.
Show me a small example (lets say 10–20 rows) of what the values of variable 2 look like.
Variables 2 are just percentages, as you can see from the previous example.
Many of us will not (or cannot) download Microsoft Office files because they are a security risk. However, if you can just type or paste the example into your message, then we can see it.
AIR_5006m | AIR_500_1year | AIR_500_2years | AIR_500_5years | AIR_500_10years | AIR_200006m | AIR_20000_1year | AIR_20000_2years | AIR_20000_5years |
1.00% | 1.00% | 1.01% | 1.02% | 1.05% | 4.01% | 4.03% | 4.03% | 4.03% |
3.00% | 3.92% | 4.03% | 4.01% | 4.01% | 4.01% | 1.05% | 4.03% | 4.01% |
3.96% | 3.92% | 4.03% | 4.01% | 4.01% | 4.03% | 4.01% | 4.03% | 1.05% |
So where you said you had two variables, the second variable is really (approximately) 10 variables?
And you want new variables to be used: time and either (500,20000).
Is that correct?
Yes, for each time period (6 months, 1 year, etc.) and each amount (500 and 20000) I have a corresponding interest rate.
In order to conduct an ANOVA (or really any analysis) in SAS, you can't have variable names with the conditions of interest. The values of the variable (not the names) must contain the conditions of interest.
And for ANOVA, you need one record per condition, showing the interest rate.
So you want something like this example:
Amount TimePeriod InterestRate 500 6m 4.02 500 1yr 4.05 20000 6m 4.12 20000 1yr 4.17
You need to re-configure your data to look like the above before you can run ANOVA.
So, it is not possible to work with a wide, just with a long list?
All ANOVA in SAS (that I know) requires the layout I showed.
It means that all my dependent variables should go in one row by certain criteria (all ten dv-s) and how to conduct that?
@Aleksandar wrote:
It means that all my dependent variables should go in one row by certain criteria (all ten dv-s) and how to conduct that?
This is the first time you have mentioned that you have many dependent variables, so I am not sure what you mean, can you show me?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.