Hello All,
I am trying to transpose some stock data that I generated in R. There are two entries for one stock symbol, I will attach the photo so that you may be able to understand better what I am saying. All I want is one row, not two, for each stock symbol.
I have tried this
proc transpose data=pa.regression_stats out=pa.transposed_data;
by Var;
var estimate p_value statistic std_error;
run;
But it does the exact opposite of what I want, converting it into four rows instead of two
A merge is probably easier for this one IMO.
data want;
merge have (where=( term = '(Intercept)'))
have (where=( term = 'VFINX') rename = (estimate = vfinx_est std_error = vfinx_std_error statistic = vfinx_stat));
by Var;
run;
@skatethejake wrote:
Hello All,
I am trying to transpose some stock data that I generated in R. There are two entries for one stock symbol, I will attach the photo so that you may be able to understand better what I am saying. All I want is one row, not two, for each stock symbol.
I have tried this
proc transpose data=pa.regression_stats out=pa.transposed_data; by Var; var estimate p_value statistic std_error; run;
But it does the exact opposite of what I want, converting it into four rows instead of two
A merge is probably easier for this one IMO.
data want;
merge have (where=( term = '(Intercept)'))
have (where=( term = 'VFINX') rename = (estimate = vfinx_est std_error = vfinx_std_error statistic = vfinx_stat));
by Var;
run;
@skatethejake wrote:
Hello All,
I am trying to transpose some stock data that I generated in R. There are two entries for one stock symbol, I will attach the photo so that you may be able to understand better what I am saying. All I want is one row, not two, for each stock symbol.
I have tried this
proc transpose data=pa.regression_stats out=pa.transposed_data; by Var; var estimate p_value statistic std_error; run;
But it does the exact opposite of what I want, converting it into four rows instead of two
Have represents your input data set. Replace it with your data set name.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.