BookmarkSubscribeRSS Feed
raqthesolid
Quartz | Level 8

Hi  Friends

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.

5 REPLIES 5
raqthesolid
Quartz | Level 8

please help me if you can thanks

naveen_srini
Quartz | Level 8

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!

Ksharp
Super User

OK.

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;

run;

%mend stat;

/*At last call execute to go through each and every country*/

data _null_;

set country;

call execute('%stat(dsname=x.merg5,country='||strip(country)||',var=hhi)');

run;

After that you will see lots of datasets start with summary_ , each country has a dataset.

Xia Keshan

Message was edited by: xia keshan

Reeza
Super User

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.

Good luck

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1189 views
  • 6 likes
  • 4 in conversation