12-26-2014 01:42 AM
i have this data in which i have about 76 countries but i have three categories in mind; which are as follows ;
Frontier country= AR BA BD BG BH BW EE GH HR JM JO KE KW KZ LB LK LT MA MU NG OM PK PS RO RS SA SI TN TT UA VN ZW;
Emerging COUNTRY= AE BR CL CN CO CZ EG GR HU ID IN KR MX MY PE PH PL QA RU TH TR TW ZA
Developed COUNTRY= AT AU BE CA CH DE DK ES FI FR UK HK IE IT IL JP NL NO NZ PT SE SG US
i need to run descriptive statistics as well as regression separately on these groups. kindly help me by writing some codes . i need to run two types of regressions one is yearly and one is overall. further more i want to run regression by including all the year dummies . Thanks in advance for you kind support.
12-26-2014 04:42 AM
Hi, I'm afraid I am very busy in the middle of my work right now, and so don't have the time to look through your data in detail to understand it. Also, I'd like to ask a few questions:
1. Are you trying to build a predictive model? if so, what's your dependent variable for regression?
2. Or is your objective to build a time series model based on the qunatitative data in the dataset?
3. Your statement- "i need to run two types of regressions one is yearly and one is overall". On what variable do you want to do this?
More info can only help us to help you.
If your initial objective is to do a descriptive, I'd suggest create a 3 different macro variables that will have the value of the 3 types you mentioned frontier, developed and emerging. Then filter them to three datasets with a IN operator and an output statement, so you get 3 datasets containing 3 different groups respectively. Then do a proc univariate taking each dataset as input with the plot option, to arrive at a box plot. These tasks should get you started with descriptives.
Either way, your best bet is you need responses from folks who have the time to get the business understanding to transform them to SAS logic. If you are lucky, you should get great responses from Art, Xia,PG, Reeza, or Steven. Honestly, i am not even close to any of these guys nor I have that much time as I consumed at work. However, I like to try!
12-26-2014 05:32 AM
You want take every country as group ? Here is some code you can base on to build your own code .
Using SAS University Edition.
Fistly take unique country name :
libname x v9 '/folders/myfolders/' ;
proc sort data=x.merg5(keep=country) out=country nodupkey;by country;run;
/*make a macro to feed call execute() , you can do the same thing with proc reg*/
%macro stat(dsname= ,country=,var=);
proc summary data=&dsname(where=(country="&country")) ;
var &var ;
output out=summary_&country mean= std= /autoname;
/*At last call execute to go through each and every country*/
After that you will see lots of datasets start with summary_ , each country has a dataset.
Message was edited by: xia keshan
12-26-2014 05:48 AM
1. Create a format for your countries
2. Run proc means to get descriptive stats using BY groups and formats from Step 1. The term descriptive stats is vague.
3. Use proc reg with by groups to perform regression.
I can't access attachments at the moment so have no idea about your data.