Hello,
Hope there is someone who could help me to solve this...
I have a dataset with monthly returns for 130 stocks (the stock code is the name of column/variable). Thinking as a spreadsheet, first column contains dates, and the remaining columns contain the monthly returns. Let us name this dataset as StockReturns.dta
In another dataset, I have all the 130 stocks and some other info, such as Marketvalue, P/B ratio, number of monthly trades and so on. In this one, columns are Code, Mktvalue, etc), each observation is composed by stock Code (the same name used in the first dataset), MKT Value, etc. Let us name this dataset as StockCharacteristics.dta
I would like to select the stocks from StockCharacteristics.dta (for example, get the 10 with highest MKT Value) save their codes in a "list" and then use this list in the StockReturns.dta (could, for example, use "keek command" for the variables in the list...
Well, I know how to select the desired stocks in the second dataset; what I do not know is how to save the list with the name of stocks and the, how to get this list in the first dataset... I
I really don´t know if this is a complete dummy question, since it is very simple to do in an EXCEL environment.
Thanks, best regards,
RZ
Related Posts with Selecting variables in a dataset from observations within another dataset
Hosmer Lemeshow test for large dataHello, I am running logistic regression about 29k sample. How can I test the goodness of fit of the…
How to only keep the target icd code and its diagnose date for each obs?Hi, Below is part of my dataset. What I want to do is that for each id (row), I want to only keep …
How to analyse dummy industry panel dataHi! I would like to seek your kind advise and feedback on my regressions as I am not sure whether I…
If condition with loopsHi, I would like to fill out the out of sample stock returns based on factor values (LogSize DY MOM…
Weighted Peer market Cap - Creating variable to copy dataDear Experts I have used STATA for some time but I am still amateur. I have to create weighted pee…
Subscribe to:
Post Comments (Atom)
0 Response to Selecting variables in a dataset from observations within another dataset
Post a Comment