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
Graph Workflow (https://ift.tt/2vUXch6)My apologies for the unsolicited ad, but I believe that this announcement could be of interest to so…
Fixed effects in RD plotsHi, I am trying to generate RD plots with and without year FEs, but the graph doesn't look smoothed …
Selecting Controls based on time from admission to eventHello, I have a dataset of unique observations that have been grouped according to whether the part…
Latex with StataHi what is the command to present the results of summarize and esttab commands in latex, please …
MAC OSX directoryHello, I am using a Mac OS X, and I am sharing a do file with others who are using PC. I need to c…
Subscribe to:
Post Comments (Atom)
0 Response to Selecting variables in a dataset from observations within another dataset
Post a Comment