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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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