BookmarkSubscribeRSS Feed
Heldermedice
Calcite | Level 5
Hi,

Could anyone suggest a code for calculating a multiyear analysis for adjusted yields?
5 REPLIES 5
mkeintz
PROC Star

What does your starting data look like?  (sample data please).

 

What are you adjusting for?  Stock splits?  Other events?

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Heldermedice
Calcite | Level 5

Thanks for the answer mkeintz,

 

I am an agronomist, so I have to calculate genetic gain of corn yield during 4 years.

I must compare the means but I can´t use the Proc Means or Proc Glm.

I am trying to use Proc Mixed to calculate the Adjusted Means by using a mixed models.

 

Follow my sample of data:

 

DATA GENETIC GAIN;
INPUT
YEAR SEASON$ LOCATION$ REP TREATMENT YIELD ;
CARDS;
1989 WINTER MINNEAPOLIS 1 1 1200
1989 WINTER MINNEAPOLIS 1 2 960
1989 WINTER MINNEAPOLIS 1 3 1480
1989 WINTER MINNEAPOLIS 1 4 1240
1989 WINTER MINNEAPOLIS 1 5 1340
1989 WINTER MINNEAPOLIS 1 6 1360
1989 WINTER MINNEAPOLIS 1 7 1320
1989 WINTER MINNEAPOLIS 1 8 1380
1989 WINTER MINNEAPOLIS 1 9 1120
1989 WINTER MINNEAPOLIS 1 10 920
1989 WINTER MINNEAPOLIS 1 11 880
1989 WINTER MINNEAPOLIS 1 12 1260
1989 WINTER MINNEAPOLIS 1 13 1100
1989 WINTER MINNEAPOLIS 1 14 1340
1989 WINTER MINNEAPOLIS 1 15 1240
1989 WINTER MINNEAPOLIS 1 16 820
1989 WINTER MINNEAPOLIS 1 17 1240
1989 WINTER MINNEAPOLIS 1 18 1280
1989 WINTER MINNEAPOLIS 1 19 920
1989 WINTER MINNEAPOLIS 1 20 1280
1989 WINTER MINNEAPOLIS 2 1 1200
1989 WINTER MINNEAPOLIS 2 2 940
1989 WINTER MINNEAPOLIS 2 3 1000
1989 WINTER MINNEAPOLIS 2 4 1540
1989 WINTER MINNEAPOLIS 2 5 1400
1989 WINTER MINNEAPOLIS 2 6 1340
1989 WINTER MINNEAPOLIS 2 7 1440
1989 WINTER MINNEAPOLIS 2 8 1060
1989 WINTER MINNEAPOLIS 2 9 1000
1989 WINTER MINNEAPOLIS 2 10 900
1989 WINTER MINNEAPOLIS 2 11 960
1989 WINTER MINNEAPOLIS 2 12 1240
1989 WINTER MINNEAPOLIS 2 13 1040
1989 WINTER MINNEAPOLIS 2 14 1120
1989 WINTER MINNEAPOLIS 2 15 1100
1989 WINTER MINNEAPOLIS 2 16 1000
1989 WINTER MINNEAPOLIS 2 17 1360
1989 WINTER MINNEAPOLIS 2 18 1180
1989 WINTER MINNEAPOLIS 2 19 1120
1989 WINTER MINNEAPOLIS 2 20 1320
 
PROC PRINT;
RUN;

 

ballardw
Super User

Yield of what? Nuclear weapons? Grain fields? Yards in NFL Games?

Heldermedice
Calcite | Level 5

Hi ballard,

 

Yield of grain corn.

 

Thanks for the answer mkeintz,

 

I am an agronomist, so I have to calculate genetic gain of corn yield during 4 years.

I must compare the means but I can´t use the Proc Means or Proc Glm.

I am trying to use Proc Mixed to calculate the Adjusted Means by using a mixed models.

mkeintz
PROC Star

Does this sas note Usage Note 24497: Can I get adjusted or least-squares means (LSMEANS) in PROC SURVEYREG? address your question?

 

Also the sas documentation has a section (for GLM) on the  LSMEANS Statement.  And the documentation for the MEANS statement includes this guidance:  "Note that the arithmetic means are not adjusted for other effects in the model; for adjusted means, see the section LSMEANS Statement."

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1337 views
  • 1 like
  • 3 in conversation