Forming Portfolios

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Forming Portfolios

Hi,

I am having some difficulty trying to ceate portfolios in sas. So I have a funds data and i ant to ceate 3 separate portfolios based on 

(1)funds with no lockup (lockup=0), and

(2) funds with lockup (lockup >0)


Accepted Solutions
Solution
‎03-04-2016 09:07 AM
Super User
Posts: 11,343

Re: Forming Portfolios

Assuming the name of your existing dataset is HAVE, you can do something similar to:

 

data Portfolio_1 Portfolio_2;

   set have;

   if lockup=0 then output Portfolio_1;

   else output Portfolio_2;

run;

 

But with that variable lockup you could much analysis leaving the data in set, sort by the lockup variable and then process with BY statements using the lockup variable.

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Forming Portfolios

We need more details to provide much help.

What does your current data look like?

What do you need the result to look like?

You only mention two rules, where would the third group come from?

Occasional Contributor
Posts: 15

Re: Forming Portfolios

Hi,

I have a data set on hedge funds (a combination of the reuturns and the characteristics)

I meant to say 2 instead of 3. 

So I am trying to form to different portfolios from the data. 

The first portfolio will containe funds with lock up 

And the second will contain funds with no lock up

Super User
Posts: 11,343

Re: Forming Portfolios

"Portfolio" is not a native SAS term, so you need to express it in terms SAS can understand. Do you want to add a variable to a dataset to indicate which "portfolio" a record belongs to?

Do you want to separate a single dataset into two datasets?

Do you have a variable named LOCKUP in the data? If not, how is "lock up" determined from values of one or more variables in the data?

Occasional Contributor
Posts: 15

Re: Forming Portfolios

 I have something like this. For instance;

Code   Mainstrategy           Aum      Lockup  ....

T112   Emerging market  12343       0

T119   Event driven         23432       1

T564    CTA                    45667        0

 

So I want to separate this data set into two based on the lockup. So one will be for lockup=1 and the other for lockup=0

 

Occasional Contributor
Posts: 15

Re: Forming Portfolios

So I have provision for lockup already
Solution
‎03-04-2016 09:07 AM
Super User
Posts: 11,343

Re: Forming Portfolios

Assuming the name of your existing dataset is HAVE, you can do something similar to:

 

data Portfolio_1 Portfolio_2;

   set have;

   if lockup=0 then output Portfolio_1;

   else output Portfolio_2;

run;

 

But with that variable lockup you could much analysis leaving the data in set, sort by the lockup variable and then process with BY statements using the lockup variable.

Occasional Contributor
Posts: 15

Re: Forming Portfolios

Thank you very much. This was helpful. I am pretty new at this.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 459 views
  • 0 likes
  • 2 in conversation