Programming the statistical procedures from SAS

Different values same code

Reply
New Contributor
Posts: 3

Different values same code

Hello,

 

I am using SAS University Edition to complete an assignment for my stats class with my partner and I am having an issue. We are trying to fit a heterogeneous error covariance structure to a dataset and have been given some benchmark results to make sure we are on the right track. Unfortunately, my partner and I have exactly the same code (copied directly from a word document) and while he is getting the correct value, I am not. He is using a mac and I'm using a PC and I get the same value in google chrome and internet explorer. Perhaps there is some difference in these two operating systems that I'm unaware of? Any help would be greatly appreciated.

 

Here is an example of my code:

 

proc sort data=first; by block var;

proc glimmix data=first;

class block var;

model leaf=var;

random block;

random _residual_ / subject=block*var group=var;

lsmeans var / pdiff adjust=tukey;

output out=second predicted=pred student=studentresid student(noblup)=smresid;

run;

Esteemed Advisor
Posts: 6,284

Re: Different values same code

Have you made sure that both of your "first" datasets are identical?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: Different values same code

yes, the data sets and code are identical. We copied the entire code (containing the datasets) into SAS into a word document and used that same code with no changes into my SAS with different results. 

Grand Advisor
Posts: 16,893

Re: Different values same code

Can you post the code used with data so one of us can replicate and let you know what the correct value is?

 

Did you confirm the issues mentioned?

 

Word has messed up files previously such that data can be read differently especially if you're using datalines or cards to generate your data. You still need to confirm the data. In general, use notepad or notepad++/Ultraedit to edit programming files, Word and Excel like to interpret and add their own little bugs.

Grand Advisor
Posts: 16,893

Re: Different values same code

Things to check:

 

1. Source datasets are the same. Make sure they both have the same number of observations and then values. One of you could save the SAS dataset, send it to the other and you could run a proc compare to highlight the differences.

2. Make sure you're running the same version of SAS, run 

proc setinit;run;

And verify the exact same versions.

3. Check the code line by line and make sure you're logs are both clean.

Grand Advisor
Posts: 16,893

Re: Different values same code

If the differences are small, ie #####E-16 then it's a precision difference and you the difference is not significant.

New Contributor
Posts: 3

Re: Different values same code

Thanks for the reply. The value we are looking for is 0.02700 and I have 0.02709. So while the difference isn't very large, it's not insignificantly small either.

Ask a Question
Discussion stats
  • 6 replies
  • 82 views
  • 0 likes
  • 3 in conversation