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
when combining graphs, can we put the three figures in a triangular position?I know a useful command grc1leg2, can we use it to combine three figures in a triangular position, s…
Using loop to import and merge excel filesHi, Please, I have 5 excel files: "File1.xls" to "File5.xls". Each file contains only 1 sheet: "She…
Transpose and CollapseGood Morning Stata Members, Below is an example of my data structure: SchoolCode,CourseCode, V1, …
Probit marginal effects output table to WordHi, I'm trying to make a regression table using Probit which reports marginal effects, and which I …
table / collect - odd behaviourI am trying to construct a simple table following a paired -test to show the mean difference, p valu…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable by finding correlations of two other variables
Post a Comment