Hi everyone,
I am trying to create a variable [pre], the value of which will be the correlation of two other variables [price_return and equal_weighted_return].
I tried using egen, but it generated a lot of missing values even though both the variables had values applicable. My codes were the following:
sort fiscalyear
egen pred2=corr( price_return equalweightedreturnincldivi), by(fiscalyear)
(55442 missing values generated)
I am working with a panel dataset, however if i sort the data using two identifiers [company_id and fiscalyear], I am getting more missing values.
Any suggestions to solve this easy problem?
Related Posts with Creating a variable by finding correlations of two other variables
Saving option within a programDear All, I have the following rough code (it needs further amendements): Code: capture program …
New package sscpax on SSCThanks once again to Kit Baum, a new package sscpax is now available for download from SSC. In Stata…
Calculate in a loop the min and max of a series of variablesGood morning I would like to create the following operations in a single cycle (to calculate min and…
Computing rolling lagged sums with bysortDear Statalist users, I have monthly time series data on flight_delays per air_carrier. For each ai…
Computing rolling lagged sums with bysortDear Statalist users, I have monthly time series data on flight_delays per air_carrier. For each ai…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable by finding correlations of two other variables
Post a Comment