Convert a numeric value to missing for multiple variables
I have a dataset with 8200 observations and 33 questions. When any of the values for questions q1-q33 equals 9 (numeric), I want to set it to missing value (.) I know I can write syntax in a data step:...
View ArticleLogistic Regression Probability Estimation
Hi I am a learner who is trying to build my first stats model which is aiming at winning chance prediction for business quotes. The stats model I use is the logistic regression. after going through the...
View ArticleSumming Weekend values to previous Friday
HTML Code: I am finding a gap in continuous data that is throwing a wrench in a bivariate VAR. I need a way to sum the weekend data of one variable in order to match a day by day set of another (stock...
View Articledo loop question
Hello all: I have a question regarding using a do loop within a macro. Let's say I have the following code: %macro plot_loop(); %do i=1 %to 10; proc print data=x; where id=&i; run; %end; %mend; So...
View Articlemacro for iterative where statement
This macro will work when I state a single number in %reg(), but when I try to add additional numbers, for example %reg(#,#,#...) it will not run and the log states ERROR: More positional parameters...
View ArticleHow to obtain the data that does not merge?
Hi, I want to merge two data sets in the usual way, by a certain criterion, matching only the observations (by id) that are in both data sets. What I would like to know is how I might go about...
View ArticleProc logistic-multivariate logistic regression
I am doing multivariate logistic regression with CGR and OBST as dependent varaibles. I used the syntax below. But I got the message that says that OBST is not found. I am using SAS enterprise. We can...
View ArticleInteraction plots and simple effects
Any suggestion (in the context of logistic regression) to generate plots to look at interaction? I am interested in this in both the context of interval (continuous) and categorical variables. Also...
View ArticleSAS Formats question
I have a .sas file with format codes. Is it possible to call the formats using an option fmtsearch option from another sas code, or do I have to copy and paste the code in?
View ArticleSas macro code for industry a simple classification into 15 industries
************************************************************************************************************************; * SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES (prepared by...
View ArticleODS tagsets.ExcelXP formulas
Hello all: This is just an easy example (because my actual scenario is a little more complicated). My eventual goal is to output to excel via the ods tagsets.excelxp option and I want to create a...
View ArticleInterpreting interaction effects
I am not sure if this is a SAS question or a statistics question. When you specify an interaction between a categorical variable and either another categorical or interval variable SAS generates a test...
View ArticleHelp Interpretting Density Plot & Other Plot Options in SAS
I am trying to plot the distribution of scores of a continuous variable for 4 groups on one plot, and have found the best visualization for what I am looking for is using sg plot with the density fx...
View ArticleContrast and Test statments in SAS
I am having problems using these - not sure why. My var Area has six values Area 1 Area 2 Area 3 Area 4 Area 5 Area 6. Area 2 is the reference. I am trying to get Contrast and Test statements to work...
View ArticleEffect versus Reference coding
I understand the difference between these, but I had a question. It appears to me that for the parameters themself SAS compares each dummy (aka design) variable to the mean of the means of its parent...
View ArticlePlotting interacting terms
Anyone know how to do this in SAS? Ideally outside ANOVA (since I use SPSS to do ANOVA). I am looking for ways to plot the interaction between variables. Particularly troublesome is the interaction...
View ArticleHelp with Code
hey guys... I have a question with this code. Why do I get an error for Min/Max but Sum works fine? and How do I fix it? I'm grouping the variables and performing min/max etc. Code: data sales ;...
View ArticleHow to write code for confidence interval?
Hi, I've got a data set with among other things the variables for gender (M/F, i.e. 0 and 1) and for voting (yes/no, i.e. 0 and 1). I now need a confidence interval (CLM, LCLM and UCLM) for the...
View ArticleEvent/trials synatax Proc Logistic
THere is a way of coding PROC LOGISTIC that goes MODEL Event/Trials=... This uses special variables refering to how many total cases there are (I am not sure how to create this variable in SAS)....
View ArticleMarkov Decision Process in SAS?
Hello all: I've been doing some reading into Markov Decision Processes and am curious if there is a SAS procedure capable of using this method? I know of PROC MCMC but from my (albeit limited)...
View Article