Hi,
My question deals with results in Glimmix that do not show all LSMEANS with my data.
Here's my code
Data Cards;
input nozzle$ program$ sprayer$ @@;
input yield@;
output;
Cards;
......
PROC Glimmix;
class nozzle program sprayer;
model yield = nozzle|program|sprayer / DDFM=KR;
lsmeans nozzle|program|sprayer / pdiff cl adjust=sidak;
lsmeans nozzle|program|sprayer / diff lines ADJUST=sidak;
*ods output diffs=ppp lsmeans=mmm;
*ods exclude diffs lsmeans;
run;
I have 5 nozzles, 3 programs, 2 sprayers and four plots with yield data for each combination. This means with four replicates, I have 120 data points, and 8 data points for the untreated plots.
An example would look like
XR B T 120 - Where XR is my nozzle, B is my application program, T is my sprayer type, and 120 is my yield.
My issue is that my untreated plots (four for each sprayer) do not have a nozzle type or program, so the LSMEANS is not showing for comparisons of nozzle type or program.
What can I do to make my code allow for keeping untreated plot data but be able to see results for LSMEANS of program and nozzle type?
I appreciate your help and look forward to hearing back soon!
Thanks!!!
So, there is no data for nozzle=HF and sprayer=HB, which is an empty cell.
Similarly, when nozzle=NONE, you don't have programs A B or C, more empty cells.
Thus, LSMEANS is supposed to have NON-EST because of the above empty cells.
One way around this is to throw out parts of the design so now there are no empty cells (but of course, this eliminates the LSMEANS and analysis comparing the NONE to the levels that are not NONE). Another way is to write custom contrasts, but this gets complicated quickly.
My issue is that my untreated plots (four for each sprayer) do not have a nozzle type or program, so the LSMEANS is not showing for comparisons of nozzle type or program.
In a data step, set the nozzle type to "NONE" and set the program to "NONE".
Thanks for the idea! But when I tried that, it still gave me a "NON-EST" for nozzle type and program and sprayer.
One thought I had after this, was that with my sprayer "T" I used 5 nozzle types, and with my sprayer "HB" I used only 4 nozzle types. Could that be the difference in receiving a NON-EST result? And ultimately, if so, how would I correct that?
I could run the data separately by sprayer type, but I wanted to see if the yield result was different for the different sprayer types.
Thanks!
@connorferguson wrote:
Thanks for the idea! But when I tried that, it still gave me a "NON-EST" for nozzle type and program and sprayer.
Show us the parts of the output with NON-EST. Click on the {i} icon and post the output into that window (do not skip this step).
Typically, NON-EST means your data doesn't have all possible combinations of all of the interactions in your model (in other words there are empty cells).
So, does your design have cells with no data?
nozzle Least Squares Means nozzle Estimate Standard Error DF t Value Pr > |t| Alpha Lower Upper 3D Non-est . . . . . . . GA Non-est . . . . . . . GAT Non-est . . . . . . . HF Non-est . . . . . . . None Non-est . . . . . . . ULD Non-est . . . . . . .
There aren't outright empty cells, but there were a few plots that did not get harvested so an example of one of those lines would be
HF C T . -- where HF is the nozzle type, C is the program, T is the sprayer, and . as there was no yield data for that plot.
-----
Thanks!
I'm not convinced there are no empty cells in the design, as that's usually what causes NON-EST. This may have happened when you added the level NONE to two of your variables.
I changed NONE to CHK for both the nozzle type and the program, and it still resulted in NON-EST.
I think it may be less to do with the Untreated plots, and more to do with the HF nozzle which was used with sprayer "T" but not sprayer "HB". I say this as the LSMEANS comparisons of nozzle type and sprayer type show only NON EST for the HF nozzle but not for any of the others - including the untreated plots.
Is there anyway to correct the problem if it's not due to the untreated plots?
Thanks!
@connorferguson wrote:
I changed NONE to CHK for both the nozzle type and the program, and it still resulted in NON-EST.
This changes nothing, it just changes the word used for this level of the design, not the statistics.
As above, I am still suspect the interactions have missing cells, and until you examine this, I doubt you will make progress.
So show me how many observations are in each interaction. For example:
proc summary data= ...;
class nozzle program sprayer;
var yield;
output out=_stats_ n=n_yield;
run;
proc print;
run;
Hi Paige,
This was the result from the LOG
PROC summary data = Cards; class nozzle program sprayer; var yield; output out=_stats_ n=n_yield; run; NOTE: There were 116 observations read from the data set WORK.CARDS. NOTE: The data set WORK._STATS_ has 77 observations and 6 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.02 seconds cpu time 0.01 seconds
And as far as missing cells - I don't exactly know what could be doing that or even where to look as all my data lines have all pertinent information listed.
Thanks!!
I want to see the output from PROC PRINT, not the log.
Obs | nozzle | program | sprayer | _TYPE_ | _FREQ_ | n_yield |
1 |
|
|
| 0 | 116 | 113 |
2 |
|
| HB | 1 | 52 | 52 |
3 |
|
| T | 1 | 64 | 61 |
4 |
| A |
| 2 | 36 | 35 |
5 |
| B |
| 2 | 36 | 36 |
6 |
| C |
| 2 | 36 | 34 |
7 |
| None |
| 2 | 8 | 8 |
8 |
| A | HB | 3 | 16 | 16 |
9 |
| A | T | 3 | 20 | 19 |
10 |
| B | HB | 3 | 16 | 16 |
11 |
| B | T | 3 | 20 | 20 |
12 |
| C | HB | 3 | 16 | 16 |
13 |
| C | T | 3 | 20 | 18 |
14 |
| None | HB | 3 | 4 | 4 |
15 |
| None | T | 3 | 4 | 4 |
16 | 3D |
|
| 4 | 24 | 23 |
17 | GA |
|
| 4 | 24 | 24 |
18 | GAT |
|
| 4 | 24 | 24 |
19 | HF |
|
| 4 | 12 | 10 |
20 | None |
|
| 4 | 8 | 8 |
21 | ULD |
|
| 4 | 24 | 24 |
22 | 3D |
| HB | 5 | 12 | 12 |
23 | 3D |
| T | 5 | 12 | 11 |
24 | GA |
| HB | 5 | 12 | 12 |
25 | GA |
| T | 5 | 12 | 12 |
26 | GAT |
| HB | 5 | 12 | 12 |
27 | GAT |
| T | 5 | 12 | 12 |
28 | HF |
| T | 5 | 12 | 10 |
29 | None |
| HB | 5 | 4 | 4 |
30 | None |
| T | 5 | 4 | 4 |
31 | ULD |
| HB | 5 | 12 | 12 |
32 | ULD |
| T | 5 | 12 | 12 |
33 | 3D | A |
| 6 | 8 | 8 |
34 | 3D | B |
| 6 | 8 | 8 |
35 | 3D | C |
| 6 | 8 | 7 |
36 | GA | A |
| 6 | 8 | 8 |
37 | GA | B |
| 6 | 8 | 8 |
38 | GA | C |
| 6 | 8 | 8 |
39 | GAT | A |
| 6 | 8 | 8 |
40 | GAT | B |
| 6 | 8 | 8 |
41 | GAT | C |
| 6 | 8 | 8 |
42 | HF | A |
| 6 | 4 | 3 |
43 | HF | B |
| 6 | 4 | 4 |
44 | HF | C |
| 6 | 4 | 3 |
45 | None | None |
| 6 | 8 | 8 |
46 | ULD | A |
| 6 | 8 | 8 |
47 | ULD | B |
| 6 | 8 | 8 |
48 | ULD | C |
| 6 | 8 | 8 |
49 | 3D | A | HB | 7 | 4 | 4 |
50 | 3D | A | T | 7 | 4 | 4 |
51 | 3D | B | HB | 7 | 4 | 4 |
52 | 3D | B | T | 7 | 4 | 4 |
53 | 3D | C | HB | 7 | 4 | 4 |
54 | 3D | C | T | 7 | 4 | 3 |
55 | GA | A | HB | 7 | 4 | 4 |
56 | GA | A | T | 7 | 4 | 4 |
57 | GA | B | HB | 7 | 4 | 4 |
58 | GA | B | T | 7 | 4 | 4 |
59 | GA | C | HB | 7 | 4 | 4 |
60 | GA | C | T | 7 | 4 | 4 |
61 | GAT | A | HB | 7 | 4 | 4 |
62 | GAT | A | T | 7 | 4 | 4 |
63 | GAT | B | HB | 7 | 4 | 4 |
64 | GAT | B | T | 7 | 4 | 4 |
65 | GAT | C | HB | 7 | 4 | 4 |
66 | GAT | C | T | 7 | 4 | 4 |
67 | HF | A | T | 7 | 4 | 3 |
68 | HF | B | T | 7 | 4 | 4 |
69 | HF | C | T | 7 | 4 | 3 |
70 | None | None | HB | 7 | 4 | 4 |
71 | None | None | T | 7 | 4 | 4 |
72 | ULD | A | HB | 7 | 4 | 4 |
73 | ULD | A | T | 7 | 4 | 4 |
74 | ULD | B | HB | 7 | 4 | 4 |
75 | ULD | B | T | 7 | 4 | 4 |
76 | ULD | C | HB | 7 | 4 | 4 |
77 | ULD | C | T | 7 | 4 | 4 |
So, there is no data for nozzle=HF and sprayer=HB, which is an empty cell.
Similarly, when nozzle=NONE, you don't have programs A B or C, more empty cells.
Thus, LSMEANS is supposed to have NON-EST because of the above empty cells.
One way around this is to throw out parts of the design so now there are no empty cells (but of course, this eliminates the LSMEANS and analysis comparing the NONE to the levels that are not NONE). Another way is to write custom contrasts, but this gets complicated quickly.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.