BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

Hi SAS community!

 

After discussing with you in the recent one month, I gradually feel the beauty of SAS, so I decide to change from using Stata to using SAS. However, I intend to learn the code relating to what I  am doing, and I think this is a possible way to do so.

I have used the SAS EG quite a bit, so I have two main questions here:

 

1. Is there any chasm between SAS EG and SAS, because after a while using the SAS EG, I decide to move to use SAS, for it is better in the long term.

 

2. Do you know any document taught you to run OLS ( Y = x1 + x2 + x3....) with fixed effect and clustering standard error by using SAS? Because in Stata, we just only use a very easy command like: "xtreg y x1 x2 x3... i.year, fe cluster...." . I tried to google how to run OLS like that but I just received some incomplete guidance. I mean it is said I can use proc syslin to run the OLS, but I don't know how to add the "fixed effects and standard errors clustering" to the regression.

 

3. Sometimes, I also face the thing that I need to delete some observations containing some specific words for filtering data purpose, I think the reasonable way to do is to use "if... then ...delete", I am not sure if there is any other better way to do with this. Do you have a sample code for this question, say e.g, I want to delete all observation in data have in which the variable "abcd" (a character variable) contains the word "mnpd".

 

Thank you very much and have a nice weekend!

P/S: Please let me know if I posted it to the wrong place.

 
Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Most internet search engines support using the SITE: keyword to restrict the search to a specific domain. Here are some searches you might enjoy. I use <topic> to refer to whatever you are searching for. For example, you might replace <topic> by 

sas delete observations

 

<topic> site:blogs.sas.com     [will search the SAS blogs for answers]

<topic> site:communities.sas.com     [will search these Q/A forums]

<topic> site:documentation.sas.com     [will search the SAS documentation]

<topic> site:sas.com     [will search all of the above, and more]

 

 

 

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

1. SAS and Enterprise Guide are essentially the same software, with different user interfaces.

2. I don't know

3. To delete observations you don't want, you don't need a whole new data set. You can do something like this:

 

proc means data=have; /* or any other PROC */
    where findw(abcd,'mnpd')>0;
    var var1 var2 var3;
run;

SAS Blogs: https://blogs.sas.com/content/ click on All Topics and then pick topics of interest to you.

--
Paige Miller
Cynthia_sas
SAS Super FREQ

To elaborate on Enterprise Guide -- Enterprise Guide is primarily a point and click interface that communicates with SAS software. The SAS executable program could be running on your local machine, could be running on a server on your network or could be running on a server that is part of a larger installation of SAS servers -- typically involving a metadata server, a compute server, a stored process server, etc.

Enterprise Guide has 2 modes of working: 1) point and click; or 2) writing code in the EG Editor window.

My guess is that you have been using mostly the point and click interface, which is great for newer users. But do keep in mind that Enterprise Guide is only generating code for you when you point and click. You don't see the code unless you want to or need to change it. Enterprise Guide knows how to send the code to SAS. So when you click Run, that's what happens.

PROC REG is used for Ordinary Least Squares regression. This page https://support.sas.com/rnd/app/stat/procedures/Regression.html talks about the various regression procedures. Here's a page of examples:
https://support.sas.com/rnd/app/stat/procedures/reg.html

  My students have recommended this web site, maintained by UCLA. They provide an overview of SAS here: http://stats.idre.ucla.edu/sas/modules/ and an overview of data analysis examples here: http://stats.idre.ucla.edu/other/dae/ that my students have recommended. The data analysis link contains a comparison of several different statistical languages: SAS, SPSS, R, and STATA. You might find it useful to read the example for doing analysis in the language you know and then reading about the same analysis when performed in a different software package.
Hope this helps,
Cynthia

Rick_SAS
SAS Super FREQ

Most internet search engines support using the SITE: keyword to restrict the search to a specific domain. Here are some searches you might enjoy. I use <topic> to refer to whatever you are searching for. For example, you might replace <topic> by 

sas delete observations

 

<topic> site:blogs.sas.com     [will search the SAS blogs for answers]

<topic> site:communities.sas.com     [will search these Q/A forums]

<topic> site:documentation.sas.com     [will search the SAS documentation]

<topic> site:sas.com     [will search all of the above, and more]

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 457 views
  • 3 likes
  • 4 in conversation