BookmarkSubscribeRSS Feed
lesicktara08
Calcite | Level 5

I am running a proc mixed model to estimate reaction times (rt) as a function of valence (categorical variable with 2 levels: negative and neutral) and blackness (blackness_cent; continuous variable). 

 

I need to get an estimate for reaction times when the valence is solely negative and blackness is low (1 sd below mean (4.1333714)) vs. medium (mean). I am unsure how to get this specific type of estimate. The first three estimates are looking at reaction times for negative vs. neutral at different levels of blackness. The second set of three estimates look at solely negative reaction times at varying degrees of Blackness. The third set of three estimates is the same except looking solely at neutral reaction times. But I want to get reaction times for solely negative when blackness is low vs. medium (and low vs. high and medium vs. high). Below is the code. Any help would be appreciated!!

 
proc mixed data=negative_not_cent1 covtest;
class  valence stim_prime stim_targ;
model  rt  = valence|blackness_cent / solution cl;
random int e_val_nn5/ sub = subject;
random int / sub = stim_targ;
estimate 'neg vs not neg at low blackness' valence 1 -1 valence*blackness_cent -4.1333714 4.1333714/e;
estimate 'neg vs not neg at med blackness' valence 1 -1 valence*blackness_cent 0 0/e;
estimate 'neg vs not neg at high blackness ' valence 1 -1 valence*blackness_cent 4.1333714 -4.1333714/e;
 
estimate 'rt for neg at low blackness' intercept 1 valence 1 0 blackness_cent -4.1333714 valence*blackness_cent -4.1333714 0;
estimate 'rt for neg at med blackness' intercept 1 valence 1 0 blackness_cent 0 valence*blackness_cent 0 0;
estimate 'rt for neg at high blackness' intercept 1 valence 1 0 blackness_cent 4.1333714 valence*blackness_cent 4.1333714 0;
 
estimate 'rt for not neg at low blackness' intercept 1 valence 0 1 blackness_cent -4.1333714 valence*blackness_cent 0 -4.1333714;
estimate 'rt for not neg at med blackness' intercept 1 valence 0 1 blackness_cent 0 valence*blackness_cent 0 0;
estimate 'rt for not neg at high blackness' intercept 1 valence 0 1 blackness_cent 4.1333714 valence*blackness_cent 0 4.1333714;
 
run; 
2 REPLIES 2
JackieJ_SAS
SAS Employee

Hi,

When I am struggling with how to write an ESTIMATE statement, I find it helpful to write the coefficients in Excel then simply subtract.

  Neg, Low  (Col B) Neg, Med  (Col C) Neg, High (Col D) Neg, Low vs Med     (B-C) Neg, Low vs High     (B-D) Neg, Med vs High     (C-D)
Intercept 1 1 1 0 0 0
Valence=Neg 1 1 1 0 0 0
Valence=Not Neg 0 0 0 0 0 0
Blackness_cent -4.13 0 4.13 -4.13 -8.26 -4.13
Blackness_cent*Valence=Neg -4.13 0 4.13 -4.13 -8.26 -4.13
Blackness_cent*Valence=Not Neg 0 0 0 0 0 0


Your code is mostly there! You have nine ESTIMATE statements in your code. Columns B-D above match the coefficients of your ESTIMATE statements 4-6 (your second block). To compare your estimates in your second block, simply subtract their coefficients. This is what is shown in last three columns above.

So- you'd use ESTIMATE statements with the coefficients in the last three columns.


PaigeMiller
Diamond | Level 26

In my terminology, you want to get a predicted value (not an estimate) for the case where valence is solely negative and blackness is low. So, I can explain how you get predicted values from the fitted model. I hope you will write back and make it clear if my understanding is wrong and you don't want predicted values.

 

How do you get these predictions? I will let @Rick_SAS explain in his blog:

https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 573 views
  • 0 likes
  • 3 in conversation