BookmarkSubscribeRSS Feed
thadb
Calcite | Level 5

I find several examples of how to code for chi-squared test for trend using nominal/ordinal data for data that is not weighted. However, the data I use are weighted and using the syntax "trend" after the tables statement produces an error with only the following options. Anyone aware of how to perform the same test using "proc surveyfreq"?

 

711 proc surveyfreq data=y15;

712 table bmi*q69 bmi*intentions intentions*exercise/chisq row cl trend;

-----

22

202

ERROR 22-322: Syntax error, expecting one of the following: ;, (, AGREE, ALPHA, CELLCHI2, CHISQ,

CHISQ1, CL, CLWT, COL, COLUMN, COV, COVP, CV, CVWT, DDF, DEFF, DEFFCOL, DEFFROW,

DEVIATION, DF, EXPECTED, KAPPA, LRCHISQ, LRCHISQ1, NOCELLPERCENT, NOFREQ,

NOPERCENT, NOPRINT, NOSPARSE, NOSTD, NOTOTAL, NOWT, ODDSRATIO, OR, PEARSONRES,

PEARSONRESID, PLOTS, RELRISK, RISK, RISK1, RISK2, RISKDIFF, RISKDIFF1, RISKDIFF2,

ROW, RSCHISQ, RSCHISQ1, TABLE, TESTP, VAR, VARWT, WALD, WCHISQ, WLLCHISQ, WT,

WTFREQ, WTKAP, WTKAPPA.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

713 weight weight;

714 cluster psu;

715 strata stratum;

716 run;

 

8 REPLIES 8
ballardw
Super User

I don't believe that TREND is a valid Tables option in Surveyfreq.

thadb
Calcite | Level 5

Very true, that's the problem.  I am using one nominal variable and one ordinal variable with three levels, not sure else how to test it.

ballardw
Super User

You might describe your data a bit such as which variables are nominal and which ordinal, how many levels of each and what kind of "trend" you are looking to identify.

 

You may want to think more of "association" if your number of levels for each is small.

thadb
Calcite | Level 5

One variable is "intention" 1. to gain weight, 2. to lose weight, and 3. do nothing.  The second variable is how many days of the week they engage in physical activity 0, 1, 2, 3, 4, 5, 6, 7.  Basically looking to see if there is an increase days of activity when moving from one intention to another.

ballardw
Super User

Consider surveymeans with your categorical variable sich as intention as a Domain and your ordinal as a VAR variable, means and confidence limits should get you started.

 

 

thadb
Calcite | Level 5

Thank you.  I ran proc surveymeans and the mean value for each level was the same as the row percent for each level when I ran proc surveyfreq, which I guess is no surprise.  My only question is how to interpret the mean values as a test for trend?


Thanks for your input

ballardw
Super User

@thadb wrote:

Thank you.  I ran proc surveymeans and the mean value for each level was the same as the row percent for each level when I ran proc surveyfreq, which I guess is no surprise.  My only question is how to interpret the mean values as a test for trend?


Thanks for your input


Not a trend. But if the mean for physical activity days in one domain such as "gain weight" is smaller than for "lose weight" you have an indication. In lieu of a formal means test if the confidence limits don't overlap you have a very conservative test that the difference is statistically significant.

I am also not sure that 1. to gain weight, 2. to lose weight, and 3. do nothing is actually even ordinal so "trend" across these wouldn't make sense (at least to me as the implied coding goes pehaps if the coding were 3. to gain weight, 1 to lose weight, and 2. do nothing).

 

One minor problem I see with your specific domain "intention" is that both gain and lose weight could have the same  change in days of activity but the type of activity could vary based on the intent. Gain weight may be lifting weights with heavy weights and lower reps while lose weight may be more aerobic exercise.

thadb
Calcite | Level 5

Agreed, thank you again for your input.

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
  • 8 replies
  • 1775 views
  • 3 likes
  • 2 in conversation