BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mlc
Calcite | Level 5 mlc
Calcite | Level 5

Hello -

 

I'm very new to SAS and need some assistance using proc quantreg. I have a series of yield data from 1950-2015 for each county in a state. I need to use proc quant reg on each county. Should I use an array? Thanks for any input!

 

Here is a sample of part of the dataset:

 

Year AllenAndersonAtchisonBarber
195025.024.018.011.0
195111.011.013.013.0
195222.021.016.022.0
195325.026.023.011.0
195432.033.025.012.0
195531.032.035.06.0
195633.035.032.013.0
195720.024.029.016.0
195830.030.030.029.0
195926.027.025.020.0
196032.033.016.029.0
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Transpose your data so it's long rather than wide and then use a BY variable.

 

Data becomes:

 

Year County Value

 

 

 

Code becomes:

 

proc quantreq data=long ...;

BY COUNTY;

View solution in original post

4 REPLIES 4
Reeza
Super User

Transpose your data so it's long rather than wide and then use a BY variable.

 

Data becomes:

 

Year County Value

 

 

 

Code becomes:

 

proc quantreq data=long ...;

BY COUNTY;

PGStats
Opal | Level 21

.... And don't forget to sort BY COUNTY YEAR after the transpose step.

PG
mlc
Calcite | Level 5 mlc
Calcite | Level 5

Thank you! Is there a way to print the results into a more uniform result? Instead of multiple tables for each county?

 

Reeza
Super User

Yes, but that's a new question. 

 

Actually, I think there's an article out there somewhere so you can search.

You would use the ODS TABLES to capture the tables you wanted into a data set and then you can view them together.

 

Ods table parameterestimates=want;

proc reg code....;

run;

 

proc print data=want;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1489 views
  • 0 likes
  • 3 in conversation