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
Prevalence Ratio from a Logistic Model Using Continuous Predictors?Hello, I have a model that predicts a smoking outcome using a manually splined education exposures …
Work multicollinearity out of fe model.Dear reader, Thank you for reading this distress post. I have a panel dataset with store locations …
GLM and predicted margins for grouped data: "rescaling" to individual data?When using -margins- without the -expression()- option after glm binomial logit with grouped data, t…
BinScatter CommandWhy after binscatter command, stata gives msg that data in memory have changed? …
Multilevel modelling in Imputed datasetHi all, I have imputed the dataset at the individual level and have merged this with my group-level…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable by finding correlations of two other variables
Post a Comment