BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aleksandar
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Aleksandar
Obsidian | Level 7

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%

View solution in original post

16 REPLIES 16
PaigeMiller
Diamond | Level 26

Three-way ANOVA with two variables? Did you leave one out?

 

Anyway, I don't understand your description of variable 2.

--
Paige Miller
Aleksandar
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

Show me a small example (lets say 10–20 rows) of what the values of variable 2 look like.

--
Paige Miller
Aleksandar
Obsidian | Level 7
 
Aleksandar
Obsidian | Level 7

Variables 2 are just percentages, as you can see from the previous example.

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Aleksandar
Obsidian | Level 7

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%

PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
Aleksandar
Obsidian | Level 7

Yes, for each time period (6 months, 1 year, etc.) and each amount (500 and 20000) I have a corresponding interest rate. 

PaigeMiller
Diamond | Level 26

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.

 

--
Paige Miller
Aleksandar
Obsidian | Level 7

So, it is not possible to work with a wide, just with a long list?

PaigeMiller
Diamond | Level 26

All ANOVA in SAS (that I know) requires the layout I showed.

--
Paige Miller
Aleksandar
Obsidian | Level 7

It means that all my dependent variables should go in one row by certain criteria (all ten dv-s) and how to conduct that?

PaigeMiller
Diamond | Level 26

@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?

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 16 replies
  • 2644 views
  • 0 likes
  • 2 in conversation