BookmarkSubscribeRSS Feed
ale_rossi
Calcite | Level 5

Hi,

I should create a map with smoothing mortality rate for italian areas with the neighbor Matrix (for each area (row) the Matrix considers more areas (colomns)) .

 

I haven't PROC IML and I think I could't use PROC GLIMMIX.

http://www.si-folkesundhed.dk/scient.pub/sr/Icar.htm

 

I'm trying to study PROC MCMC form an example by SAS that considers the neighbor Matrix, but It doesn't work .

http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_mcmc_details61.htm&docsetVersion=1...

 

Could you help me?

Thanks,

Alessandra Rossi

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20
ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Rick_SAS
SAS Super FREQ

Try using radial smoothing functions (TYPT=RSMOOTH) as in this GLIMMIX example:

http://go.documentation.sas.com/?docsetId=statug&docsetTarget=statug_glimmix_details46.htm&docsetVer...

ale_rossi
Calcite | Level 5

Hi,

I solved using SAS Studio that has neighbour option in PROC MCMC.

I'd need to weight the single area (cod_pro) and the neighbors (cod_pro_adj) with their Observedevents .

How could I do?

 

follow my sintax without the weight

 

ods select none;
proc mcmc data=step1 seed=615926 nbi=10000 nmc=50000 thin =10
   plots=none outpost=/*OUT.*/step1post;
   parms tau_b 0.5 tau_h 0.2 provar 0.5;
   parms alpha 0;
   prior tau: ~ gamma(0.5, is=0.0005);
   prior alpha ~ general(0);
   prior provar ~ gamma(0.001, is=0.001);
   random h ~ n(0, prec=tau_h/**poptime*/) s=cod_pro; 
   random b ~ normalcar(neighbors=cod_pro_ad, num=num, prec=tau_b*num/*/poptime ObservedEvents*/) s=cod_pro;
   mu=alpha + b + h;
   model stdrate ~ normal(mu, sd=provar);
run;

 

I've attached the db with few rows.

 

Many thanks

Alessandra

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 946 views
  • 0 likes
  • 4 in conversation