BookmarkSubscribeRSS Feed
supriyamalliduu
Calcite | Level 5

Hi,

 

I plotted a trend analysis graph over time for one of my variables in the dataset. Now i wanted to see if the trend is significantly increasing or decreasing over time( I wanted to see the  p-value to know if the trend is significant). But i dont know how to do this. Any help is much appreciated.

 

Capture.JPG

 

Thank you!!

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Since we can't see the raw data, let me just say that when the vertical axis is a continuous interval, such as you show 13% to 18%, and that's all the information you have about what happened in each year, this is not logistic regression, it is ordinary least squares regression. You can fit a linear ordinary least squares model and see if the slope due to year is statistically significant.

 

Again, because you haven't shown us the RAW data, if the percent each year is computed, for example, as 9 events out of 50 (so you know the numerator and denominator in each year), then you should fit this via a logistic regression, with one X variable (YEAR), using the "events/trials" form of the MODEL statement. In this case, again, you have to find the slope of YEAR to see if it is statistically significant.

--
Paige Miller
supriyamalliduu
Calcite | Level 5

Thanks for the response.

 

The raw data is from a survey and I am actually using a proc survey freq procedure to compute the weighted frequencyies and percentages. The data i used for plotting looks like:

 

Capture.JPG

 

Do u think ordinary least squares model is the solution for us to know if the trend is significant based on this data?

 

Thanks,

Supriya

 

PaigeMiller
Diamond | Level 26

In this case, PROC SURVEYLOGISTIC ought to be used.

--
Paige Miller
Reeza
Super User

Do you only have 6 data points in the entirety of your dataset?

If so, I would consider using the raw data and a Cochrane-Armitage test which test for increasing/decreasing trends. You don't have a ton of data to support anything beyond this. You could also do a basic linear regression but I wouldn't be pushing to use anything super complex with 6 data points. 

 


@supriyamalliduu wrote:

Thanks for the response.

 

The raw data is from a survey and I am actually using a proc survey freq procedure to compute the weighted frequencyies and percentages. The data i used for plotting looks like:

 

Capture.JPG

 

Do u think ordinary least squares model is the solution for us to know if the trend is significant based on this data?

 

Thanks,

Supriya

 


 

Ksharp
Super User

You could check PROC FREQ;

 

proc freq.....

model good_bad*year/ trend ;

run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 5 replies
  • 1589 views
  • 0 likes
  • 4 in conversation