I` tried glm, glimmix and mixed models however, I still can not get p values and lsmeans. Simply, I just want to analyze the differences between foliar sprays on plant tissue nitrogen concentration, THC and biomass. There is no replication in this design.
fs=(foliar spray)
The codes I tried below;
proc mixed data=gh method=ml;
class fs;
model Nlevel = fs / s;
store out=MixedModel;
lsmeans fs/ pdiff adjust=tukey;
run;
proc glm data=gh;
class fs;
model Nlevel = fs;
means fs / tukey;
output out=results p=predicted;
run;
proc glimmix data=gh;
class fs;
model Level = fs / dist=normal solution;
random intercept / subject=fs;
lsmeans fs / pdiff adjust=tukey ;
run;
data gh;
infile datalines expandtabs truncover;
input fs$ Nlevel THC biomass;
cards;
UEC 3.68 15.94 113.0
Pot3 3.67 17.68 113
WOH 2.34 17.20 278
MEH 3.03 17.69 204
CBioH 3.07 15.86 244
PCH 2.77 18.94 169
FFH 2.77 17.75 203
VIA 2.78 18.08 283
VIM 3.40 17.59 203
Pot5 3.11 18.26 113
;
run;
Is that all the data??
Did you read the log? After I fix the Glimmix code to use the variable Nlevel in the data instead of Level this is the log I get for these procedures:
270 proc mixed data=gh method=ml; NOTE: Writing HTML Body file: sashtml1.htm 271 class frt; 272 model Nlevel = frt / s; 273 store out=MixedModel; 274 lsmeans frt/ pdiff adjust=tukey; 275 run; NOTE: An infinite likelihood is assumed in iteration 0 because of a nonpositive residual variance estimate. NOTE: The MIXED procedure generated the model item store USER.MIXEDMODEL. NOTE: PROCEDURE MIXED used (Total process time): real time 2.31 seconds cpu time 1.71 seconds 276 277 proc glm data=gh; 278 class frt; 279 model Nlevel = 280 frt; 281 means frt / tukey; 282 output out=results p=predicted; 283 run; WARNING: Mean separation procedures will not be carried out due to zero degrees of freedom for the specified error source. 284 quit; NOTE: The data set USER.RESULTS has 10 observations and 5 variables. NOTE: PROCEDURE GLM used (Total process time): real time 0.23 seconds cpu time 0.03 seconds 285 286 proc glimmix data=gh; 287 class frt; 288 model nLevel = frt / dist=normal solution; 289 random intercept / subject=frt; 290 lsmeans frt / pdiff adjust=tukey ; 291 run; WARNING: Mixed model has saturated mean and profiled variance. Fit does not proceed. NOTE: PROCEDURE GLIMMIX used (Total process time): real time 0.07 seconds cpu time 0.04 seconds
Basically data issues. Zero degrees of freedom means nothing to estimate, no test.
Missing standard deviation because only one value means no test as no variability in data
I remember that I got these warnings in the log. What do data issues mean? Is the type of the data or collected data erroneous?
@Zynep93 wrote:
I remember that I got these warnings in the log. What do data issues mean? Is the type of the data or collected data erroneous?
For a linear model you have to have at least 2 points to define a line. If there is only one there is no way to get a slope. If all of the x,y pairs present have the same x and y they are essentially one point. Nothing to connect to make line.
Degrees of freedom typically come in some of the models in an (N-1) of the actual degrees of freedom as part of the calculation for the test statistics. The DF are typically the number of values or number of value levels. If there is only one value or level then N-1 is 0 and may, again depending on the specific test and statistic get a division by 0 (undefined) or have a value not tabled for the test statistics so no result.
Not sure about the separation bit from Glimmix but suspect it is along the same lines of "not enough data" to generate a test statistic.
N test was actually measured 4 times during the experiment but I averaged all 4 time points and put as one data for each foliar spray treatment. But this may change the code, and it looks like I could have done with the repeated measures. Maybe the zero estimates and no variability stem from there.
glimmix code does not work for biomass and THC, even though these parameters are measured once only.
You do not have any replication, there is one value for each level of FS, you cannot estimate the error, and so you get missing p-values. You do NOT have enough data.
Depending on exactly what you mean by "actually measured 4 times during the experiment", this may or may not help. If you simply took 4 measurements on the same plant, or you measured 4 different plants, those cases are different. We need to know EXACTLY how these 4 measurements were done.
@Zynep93 wrote:
Thanks for your reply. So to be more specific, N data was collected for each foliar spray treated plant on May, July, August, September. Some other plants measured only on August and September.
So are you taking repeated measurements on the exact same plants? Or are you measuring different plants each month?
Yes, taking repeated measures on the exact same plants.
So truly you have no replication of levels of FS, and so no p-values are possible. The month-to-month replication do not overcome the fact that there are no replications of levels of FS.
I have attached the raw N% data.
@Zynep93 wrote:
I have attached the raw N% data.
I don't see where anyone has requested your data. And I don't see how providing this data changes anything that we have said.
However, data must be in the form of working SAS data step code (examples and instructions). Data in a Word document isn't what we need. Data in an Excel file isn't what we need. Data in a screen capture isn't what we need.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.