SAS code

#1
Hello,

I am trying to replicate this SAS code in STATA. I understand most of the commands, but I would like to know what org(upc) means. Is it like an indicator variable? Also, is the command assigning random effects for each listed variable: upc org(upc) store org

Thanks in advance!!

proc mixed data= out.sample_av2 method= ml;
by city prod_name;
class org store upc timevar city subject month;
model logprice_fill= subject/ ddfm=bw solution;
random intercept upc org(upc) store org/ subject = timevar;
ods output CovParms = out99.varcomp_pav_wst;
run;
 

hlsmith

Not a robit
#2
Not my area, but I believe it is. You may compare it to the common example, random effects for classrooms and schools as well as the combination of the two, plus couple of others things. Though, this is just my assumption.
 

Jake

Cookie Scientist
#3
The A(B) syntax in SAS indicates "A nested within B." It's basically equivalent to adding intercepts for the A*B interaction. Which, if A is "explicitly nested" in B (the levels of A within each B are uniquely labeled), is equivalent to just random intercepts for A. If A is "implicitly nested" in B (the labels for A within each B repeat, despite in fact being different levels), then A(B) is the correct syntax rather than just A. See the section "Nested Effects" here: http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_mixed_sect023.htm
 

Jake

Cookie Scientist
#5
It says that all of the effects between the word "random" and the "/" character are varying across the levels of the "timevar" variable, whatever that is.
 
#7
Thank you Jake and hlsmith. Although, your last comments aren't clear enough to me. Do you think its definining those random effects as interactions between each variable and timevar?

My intention is to implement this code in STATA...
 
Last edited: