Fluorite | Level 6

## F Test for Least Squares Means Estimates formula

Hello everyone,

I am trying to understand how the joint F value from proc mixed using lsmestimate option is being calculated. An example data, sas

data test;
input Y visitno subid;
datalines;
7 1 1
9 1 2
8 1 3
7 2 1
8 2 2
6 2 3
;

proc mixed data=test ;
class visitno subid;
model y = visitno/solution outp=pred ;
repeated visitno /type=un subject=subid;
*contrast 'visitno' [1 1], [1 2];
lsmestimate visitno [1 1], [1 2]/joint(chisq) cl e;
run;

```Least Squares Means Estimates
Effect Label Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper
visitno Row 1 8.0000 0.5774 2 13.86 0.0052 0.05 5.5159 10.4841
visitno Row 2 7.0000 0.5774 2 12.12 0.0067 0.05 4.5159 9.4841

F Test for Least Squares Means Estimates
Effect Num DF Den DF Chi-Square F Value Pr > ChiSq Pr > F
visitno 2 2 228.00 114.00 <.0001 0.0087

```

Can someone help me understand how the F Value of 114 is derived?

Best,

Divine

1 ACCEPTED SOLUTION

Accepted Solutions
Diamond | Level 26

## Re: F Test for Least Squares Means Estimates formula

5 REPLIES 5
Diamond | Level 26

## Re: F Test for Least Squares Means Estimates formula

Please click on the {i} icon and paste the output into the window that appears. This will maintain the formatting of your output, and make it readable.

--
Paige Miller
Diamond | Level 26

## Re: F Test for Least Squares Means Estimates formula

The Chi-squared value is computed to be 228, so the F-value is 228/2 = 114.

For future reference, I wanted you to copy the TEXT from the LISTING window and paste it into the {i} window. If you copy the HTML, it still isn't very readable. If you don't have a LISTING window, then a screen capture of the HTML is fine.

--
Paige Miller
Fluorite | Level 6

## Re: F Test for Least Squares Means Estimates formula

Thank you PaigeMiller.

Diamond | Level 26

## Re: F Test for Least Squares Means Estimates formula

Fluorite | Level 6

## Re: F Test for Least Squares Means Estimates formula

Thank you again!

Discussion stats
• 5 replies
• 365 views
• 2 likes
• 2 in conversation