BookmarkSubscribeRSS Feed
DaviLaraia
Fluorite | Level 6
Dear Sir or Madam, I have read the documentation of the GA Procedure and it seems a powerful tool for optimization problems. I'm currently working on an optimization problem whose one of the objetives is to maximize the spearman correlation between a set of two variables. I know that SAS has specific procedures to calculate the correlation between variables, so I would like to know if there is a way to include these procedures inside the Objective Function Definition inside a GA procedure? Thanks in advance. Best Regards, Davi Laraia
2 REPLIES 2
gergely_batho
SAS Employee

It is possible to call a SAS proc (e.g.: proc corr) from a function defined in proc ga using the dusubl() function.

First you will need to create the input data source of proc corr, then call procc corr using dosubl(), then read the results from the created dataset (open(), read(),... functions).

If this is realy just calculating correlation and data is already in variables of proc ga, I would write the calculation myself.

DaviLaraia
Fluorite | Level 6
Dear gergely_batho, First of all, thank you for your quick response. I was looking for a way to use proc corr because it is already optimized and all the details (sorting, ranking and treatment of ties) are already implemented. It´s a good idea to write the calculation myself and I'm considering it, but that would require in my case a validation of this procedure by a third party extending significantly the time of this project. I've never worked with the dusubl() function, so I'll give it a try. Thank you! Best Regards, Davi Laraia

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Discussion stats
  • 2 replies
  • 1406 views
  • 1 like
  • 2 in conversation