sas

How to get MSE of ARIMA model in SAS?

自古美人都是妖i 提交于 2020-01-06 20:10:41
问题 I am comparing two models, one with exponential smoothing and one with ARIMA. For this specific assignment, it's enough that I compare the MSE of the two models. So how do I compute the MSE of the ARIMA procedure? This is the last assignment on this grueling course, help would be greatly appreciated! 回答1: proc arima does not specifically output the MSE, but proc model does. You can recreate the ARIMA model using proc model and the %AR and %MA macros. proc model data=have; endo y; id date; y =

Merging two datasets conditional on 3 variables in SAS

不羁岁月 提交于 2020-01-06 19:50:17
问题 I am quite new to using SAS and would like to ask for your help on merging two datasets that do not contain one key identifier but require a combination of three conditions to be merged successfully. I have two datasets: Dataset 1 contains information on client visits including StartDate , EndDate , EmployeeNumber and CustomerNumber . Dataset 2 contains information on certain activities that may have been performed during the visits in addition to the "Date" when the activity has been carried

Compare a variable in two different data-sets in SAS

守給你的承諾、 提交于 2020-01-06 19:06:14
问题 I need to compare two variables in two different data-sets which has different names for the variables, then i need to write the observations in SASYES if the records match else write it to SASNO. I am retrieving the records from DB2 and renaming the variables. my sas code DATA _NULL_; SET WORKLIST; SET UNITFUNC; IF PRIMNUM=CORRPMNM AND MODELCD=MCMODEL THEN DO; FILE SASYES; PUT @01 ANSFACT1 $CHAR7. @09 CORRPMNM $CHAR12. @21 MCMODEL $CHAR8. OUTPUT SASYES; END; ELSE DO; FILE SASNO; PUT @01

Compare a variable in two different data-sets in SAS

强颜欢笑 提交于 2020-01-06 19:06:03
问题 I need to compare two variables in two different data-sets which has different names for the variables, then i need to write the observations in SASYES if the records match else write it to SASNO. I am retrieving the records from DB2 and renaming the variables. my sas code DATA _NULL_; SET WORKLIST; SET UNITFUNC; IF PRIMNUM=CORRPMNM AND MODELCD=MCMODEL THEN DO; FILE SASYES; PUT @01 ANSFACT1 $CHAR7. @09 CORRPMNM $CHAR12. @21 MCMODEL $CHAR8. OUTPUT SASYES; END; ELSE DO; FILE SASNO; PUT @01

How can I use different symbols for groups of x*y=z plots in proc gplot?

梦想的初衷 提交于 2020-01-06 18:44:02
问题 What I'm trying to do: I'm creating plots using the code below. PERIOD has 3 different values, so the plot and plot2 statements each create 3 series on the plot via an x*y=z type of plot request. I want the 3 series from the plot statement to have symbols that are joined up, and I want the 3 series from the plot2 statement to have symbols that are not joined up. Whatever solution I come up with needs to work inside a macro. The problem No matter what I try, all 6 series on each chart end up

SAS Change the Proportion of a Random Sample

隐身守侯 提交于 2020-01-06 17:46:32
问题 Is there a way to change and manipulate the proportion of a variable in SAS in random sampling? Lets say that I have table consisting 1000 people. (500 male and 500 female) If I want to have a random sample of 100 with gender strata - I will have 50 males and 50 females in my output. I want to learn if there is a way to have the desired proportion of gender values? Can ı have a random sample of 100 with 70 males and 30 females ? 回答1: PROC SURVEYSELECT is the way to do this, using a dataset

SAS: macro generating data driven subset data files

给你一囗甜甜゛ 提交于 2020-01-06 15:15:14
问题 Using SAS macro, I would like to generate subset of files using data driven method. Can someone direct me where to start? For example, I have a data set like following: data student; var v1 $ v2 $ v3; datalines ; f j 20 f j 20 f j 22 f s 18 f s 18 m j 19 m j 19 m s 20; Instead of using 'if' statement for each variable category, I want SAS macro recognize each value in variables and make subsets of data. Do I need to look into loop function or symput (after making proc freq)? thank you, KKK

SAS: how to save multiple ODS output from a %DO loop

情到浓时终转凉″ 提交于 2020-01-06 08:43:17
问题 data scores; length name $ 12; input name $ score1 score2; datalines; Riley 1132 1187 Henderson 1015 1102 ; %MACRO DO_MEAN; %DO I = 1 %TO 10; PROC MEANS data = scores; VAR score1; TITLE "Average math score"; RUN; %END; %MEND DO_MEAN; ods output Summary = Summary; %DO_MEAN; I have a simple macro called %DO_MEAN that calculates the mean score1 in my dataset. I want the macro to run from i = 1 to 10 times. Invoking the macro outputs the results of the MEANS procedure 10 times. And yes, I know

How to mask “OR” in sub-macro with variable list passed through using SYSPBUFF in macro

痴心易碎 提交于 2020-01-06 08:28:31
问题 I'm using SYSPBUFF to pass through various numbers of parameters into a macro. Specifically, I am passing through a list of states (inner query) and regions (outer query). One of the states being used is Oregon which abbreviates to "OR" and that one state is causing me error. I previously asked an almost identical question and got a response that solved the problem. However, now I am adding the working macro within another macro and it no longer works anymore. What am I missing in the outer

How can I get the identification number with each groups?

允我心安 提交于 2020-01-06 07:06:17
问题 The following is a brief of my data sheet, stnd_y person_id recu_day date 2002 100 20020929 02-09-29 2002 100 20020930 02-09-30 2002 100 20021002 02-10-02 2002 101 20020927 02-09-27 2002 101 20020928 02-09-28 2002 102 20021001 02-10-01 2002 103 20021003 02-10-03 2002 104 20021108 02-11-08 2002 104 20021112 02-11-12 And, I want to make those as follows stnd_y person_id recu_day date Admission 2002 100 20020929 02-09-29 1 2002 100 20020930 02-09-30 2 2002 100 20021002 02-10-02 3 2002 101