BookmarkSubscribeRSS Feed
srikanthyadav44
Quartz | Level 8

dear all

i run  regression separatey for each industry and each year in the panel data. 

I have to save the values of actual, predicated and residuals. 

 

the input file for the regression is as follows 

COMPANY_NAMEYEARNIC_CODEDVIV_1IV_2IV_3
A D F Foods Ltd.2011100.1785260.0007960.8818050.080548
Agro Tech Foods Ltd.201110-0.148110.0003492.4967680.238252
Ajanta Soya Ltd.201110-0.163640.0020646.2257531.438506
Andrew Yule & Co. Ltd.2011100.0989880.0002180.5483050.125093
Arcuttipore Tea Co. Ltd.2011100.0090090.0075080.21997-0.0045
Assam Company India Ltd.2011100.0211179.55E-050.211948-0.00285
Avanti Feeds Ltd.201110-0.067350.0008491.7625280.947087
B & A Ltd.2011100.1684810.0011110.8358510.079853
B C L Industries Ltd.201110-0.051690.0007183.3279971.185284
Bajaj Hindusthan Sugar Ltd.2011100.1422099E-060.4435270.184995
A D F Foods Ltd.2012100.049940.0006310.7083150.008839
Agro Tech Foods Ltd.2012100.0973510.0003542.474027-0.05294
Ajanta Soya Ltd.2012100.0708180.0018596.8697031.261896
Andrew Yule & Co. Ltd.2012100.0670420.0002140.6225070.083985
Arcuttipore Tea Co. Ltd.201210-0.014750.0077640.196429-0.03106
Assam Company India Ltd.2012100.0382778.29E-050.2326060.048619
Avanti Feeds Ltd.2012100.34810.0006912.7165171.282377
B & A Ltd.2012100.1351320.0010220.8394150.070122
B C L Industries Ltd.201210-0.045460.0005592.9027090.313544
Bajaj Hindusthan Sugar Ltd.201210-0.04579.77E-060.416821-0.06456
Associated Alcohols & Breweries Ltd.201111-0.029650.0010520.9540480.105889
Belapur Industries Ltd.2011110.0080210.0133690.155080.001337
Bio Green Papers Ltd.2011110.0974040.0022190.193033-0.04038
Chaman Lal Setia Exports Ltd.2011110.0705170.0011811.984408-0.20872
Elegant Floriculture & Agrotech (India) Ltd.201111-0.275490.0060680.0400490.004854
Empee Distilleries Ltd.2011110.117970.0002460.6906890.029437
Flex Foods Ltd.2011110.1275560.0013190.6050650.111727
G M Breweries Ltd.2011110.2905240.0008682.0068550.103523
Associated Alcohols & Breweries Ltd.2012110.2044660.0008931.2361770.425726
Belapur Industries Ltd.201211-0.016640.013870.1789180.018031
Chaman Lal Setia Exports Ltd.201211-0.019030.0010122.2015990.501366
Elegant Floriculture & Agrotech (India) Ltd.201211-0.013410.0047890.03113-0.00048
Empee Distilleries Ltd.2012110.1888020.0002010.9354920.371738
Flex Foods Ltd.2012110.1034620.0013420.6748520.059313
G M Breweries Ltd.2012110.1272830.0006741.6872180.1289
G R Cables Ltd.201211-0.004450.0074130.0066720.002965
Gangotri Textiles Ltd.2012110.0280390.0002030.324616-0.09635
Gujarat Ambuja Exports Ltd.201211-0.004140.00012.1230770.172181
Himalaya Food Intl. Ltd.2012110.1061640.000390.4217710.100706

 

i run the following regression code in SAS

 proc reg data=have; 

model  DV=IV_1 IV_2 IV_3;

by NIC_Code  year;

run;

 

i want to save the required variables from the output in the following format

COMPANY_NAMEYEARNIC_CODEActual PredictedResidual
A D F Foods Ltd.2011    
Agro Tech Foods Ltd.2011    
Ajanta Soya Ltd.2011    
Andrew Yule & Co. Ltd.2011    
Arcuttipore Tea Co. Ltd.2011    
Assam Company India Ltd.2011    
Avanti Feeds Ltd.2011    
B & A Ltd.2011    
B C L Industries Ltd.2011    
Bajaj Hindusthan Sugar Ltd.2011    
A D F Foods Ltd.2012    
Agro Tech Foods Ltd.2012    
Ajanta Soya Ltd.2012    
Andrew Yule & Co. Ltd.2012    
Arcuttipore Tea Co. Ltd.2012    
Assam Company India Ltd.2012    
Avanti Feeds Ltd.2012    
B & A Ltd.2012    
B C L Industries Ltd.2012    
Bajaj Hindusthan Sugar Ltd.2012    
Associated Alcohols & Breweries Ltd.2011    
Belapur Industries Ltd.2011    
Bio Green Papers Ltd.2011    
Chaman Lal Setia Exports Ltd.2011    
Elegant Floriculture & Agrotech (India) Ltd.2011    
Empee Distilleries Ltd.2011    
Flex Foods Ltd.2011    
G M Breweries Ltd.2011    
Associated Alcohols & Breweries Ltd.2012    
Belapur Industries Ltd.2012    
Chaman Lal Setia Exports Ltd.2012    
Elegant Floriculture & Agrotech (India) Ltd.2012    
Empee Distilleries Ltd.2012    
Flex Foods Ltd.2012    
G M Breweries Ltd.2012    
G R Cables Ltd.2012    
Gangotri Textiles Ltd.2012    
Gujarat Ambuja Exports Ltd.2012    
Himalaya Food Intl. Ltd.2012    

 

please help in writing the SAS code which can generate a separate file the the required variables in the above mentioned format. 

thanks in advance 

 

1 REPLY 1

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 520 views
  • 1 like
  • 2 in conversation