turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-24-2011 03:29 AM

Is there any way to do in IML the optimal matching (like in PROC ASSIGN) ?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

02-24-2011 08:14 AM

Is there a way? Yes, but that doesn't mean it is the best or easiest way. If you previously used PROC ASSIGN (which is part of SAS/OR software), I suggest using PROC OPTMODEL, which provides a natural way to specify linear programming problems and is designed specifically for linear programming. For details and an example, see http://support.sas.com/kb/42/143.html

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-24-2011 08:29 AM

Thanks for the reply. The distance I am using for matching is the generalized Mahalanobis distance GMD (with some weights, http://sekhon.berkeley.edu/papers/GenMatch.pdf), which is easy to calculate in IML. The loop is:

1. start with initial set of weights

2. create GMD matrix

3. do optimal match

4. check balance of covariates between matched cases and controls

5. if unbalanced then modify weights and goto 2.

I don't know how to do this matrix algebra in OPTMODEL.

1. start with initial set of weights

2. create GMD matrix

3. do optimal match

4. check balance of covariates between matched cases and controls

5. if unbalanced then modify weights and goto 2.

I don't know how to do this matrix algebra in OPTMODEL.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

02-24-2011 09:39 AM

Sounds like an interesting problem. Could you post a simple example (4 or 5 observations) and the code you have so far, so we can better understand the problem? I've never used PROC ASSIGN so it would be helpful to see an example.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-25-2011 10:14 AM

The code gets truncated here, how can I send it to you ?
Message was edited by: Zbig

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

02-24-2011 08:48 AM

OK, I know now how to do this algebra in OPTMODEL (this is the multiplicative product of several matrices only, I can code it). But the IML gives me the Genetic Algorithm framework, which is not available in OPTMODEL.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

02-25-2011 01:21 PM

What version of IML are you using? If you are using PROC IML, the latest version, 9.22, allows you to submit arbitrary SAS code from inside your IML program via a SUBMIT block. So, if you have this version of IML and you have SAS/OR, you should be able to use the fast and exact solvers in SAS/OR to solve the optimization problem exactly and quickly (provided you have a manageable problem size). If you have an earlier version of SAS/IML, if you can use IML Studio that also has a SUBMIT block for submitting SAS code. It is possible to apply genetic algorithms (GA) in PROC IML to try to solve the optimization problem, but the problem with GA in general is that you are not guaranteed convergence, and if you do get a solution you have no way to know if it is the true global optimum. Also for a problem of this type, the integer linear programming solvers available in SAS/OR will use a fraction of the time that a GA would use. So, do you have a version of IML with the SUBMIT block available? If so that would be far preferable to trying to use GA.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Hutch_sas

02-25-2011 03:19 PM

I want to run GA and for each individual (which is a set of weights to be used to calculate generalized mahalanobis distances) I need to perform optimal matching. This is why it is important to do it within IML, as calling external procedure would take time.

I think I have managed to use IML's LP function to do the optimal match. Thanks. But apparently the IML's LP is much much slower than LP solver in OPTMODEL ...

Message was edited by: Zbig

I think I have managed to use IML's LP function to do the optimal match. Thanks. But apparently the IML's LP is much much slower than LP solver in OPTMODEL ...

Message was edited by: Zbig