I was working on a HW assignment and stumbled across a problem. I have the two ods output statements as placeholders until I know how to locate the table names. How do I find the table names and what are they given this scenario?
I will attach code, the log file and part of the assignment as well. Any help would be greatly appreciated!
ods select anova;
proc reg data = drivingclass;
model drivingclass = Hours Score;
ods output anova=anova_table;
ods output ParameterEstimates=estimates;
run;
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
69
70 /* S325 HW 3
71 By Joshua Gataric
72 9/23/2022
73 */
74
75 ods trace on;
76 data drivingclass;
77 infile '/home/u62108616/sasuser.v94/S325/driving class-1.dat';
78 if _n_ <=15 then Campus = 'A';
79 else Campus = 'B';
80 input Hours Score;
81
82 ods trace on;
NOTE: The infile '/home/u62108616/sasuser.v94/S325/driving class-1.dat' is:
Filename=/home/u62108616/sasuser.v94/S325/driving class-1.dat,
Owner Name=u62108616,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=23Sep2022:09:35:42,
File Size (bytes)=391
NOTE: 30 records were read from the infile '/home/u62108616/sasuser.v94/S325/driving class-1.dat'.
The minimum record length was 11.
The maximum record length was 12.
NOTE: The data set WORK.DRIVINGCLASS has 30 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 868.81k
OS Memory 31652.00k
Timestamp 09/23/2022 05:32:25 PM
Step Count 267 Switch Count 3
Page Faults 0
Page Reclaims 92
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
83 proc print data = drivingclass;
84 run;
Output Added:
-------------
Name: Print
Label: Data Set WORK.DRIVINGCLASS
Data Name: ProcPrintTable
Path: Print.Print
-------------
NOTE: There were 30 observations read from the data set WORK.DRIVINGCLASS.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.03 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 1253.15k
OS Memory 31652.00k
Timestamp 09/23/2022 05:32:25 PM
Step Count 268 Switch Count 0
Page Faults 0
Page Reclaims 60
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
85
86
87 proc means data = drivingclass maxdec = 2;
88 class Campus;
89 var Score;
90 ods output summary = DRIVING;
91 run;
9/23/22, 10:32 AM Log: HW3_JoshuaGataric.sas
2/3
Output Added:
-------------
Name: Summary
Label: Summary statistics
Template: base.summary
Path: Means.Summary
-------------
NOTE: The data set WORK.DRIVING has 2 observations and 7 variables.
NOTE: There were 30 observations read from the data set WORK.DRIVINGCLASS.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.01 seconds
memory 9671.59k
OS Memory 39612.00k
Timestamp 09/23/2022 05:32:25 PM
Step Count 269 Switch Count 4
Page Faults 0
Page Reclaims 1952
Page Swaps 0
Voluntary Context Switches 35
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
92
93 ods select anova;
94 proc reg data = drivingclass;
95 model drivingclass = Hours Score;
ERROR: Variable DRIVINGCLASS not found.
NOTE: The previous statement has been deleted.
96 ods output anova=anova_table;
97 ods output ParameterEstimates=estimates;
98 run;
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 2100.65k
OS Memory 33468.00k
Timestamp 09/23/2022 05:32:25 PM
Step Count 270 Switch Count 2
Page Faults 0
Page Reclaims 254
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 48
WARNING: Output 'ParameterEstimates' was not created. Make sure that the output object name, label, or path is spelled correctly.
Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used.
WARNING: Output 'anova' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify
that the appropriate procedure options are used to produce the requested output object. For example, verify that the
NOPRINT option is not used.
WARNING: Output 'anova' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify
that the appropriate procedure options are used to produce the requested output object. For example, verify that the
NOPRINT option is not used.
99
100 proc corr data = drivingclass;
101 var Hours Score;
102 run;
Output Added:
-------------
Name: VarInformation
Label: Variables Information
Template: base.corr.VarInfo
Path: Corr.VarInformation
-------------
Output Added:
-------------
Name: SimpleStats
Label: Simple Statistics
Template: base.corr.UniStat
Path: Corr.SimpleStats
9/23/22, 10:32 AM Log: HW3_JoshuaGataric.sas
3/3
-------------
Output Added:
-------------
Name: PearsonCorr
Label: Pearson Correlations
Template: base.corr.StackedMatrix
Path: Corr.PearsonCorr
-------------
NOTE: PROCEDURE CORR used (Total process time):
real time 0.02 seconds
user cpu time 0.03 seconds
system cpu time 0.00 seconds
memory 970.31k
OS Memory 31908.00k
Timestamp 09/23/2022 05:32:25 PM
Step Count 271 Switch Count 0
Page Faults 0
Page Reclaims 51
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 16
103 ods trace off;
104
105 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
115
Run a regression model to test the relationship between class hour (independent variable) and
performance score (dependent variable).
Use ods trace statement to generate the ANOVA table and the parameter estimates outputs only from
the regression results (Use ODS select). (You need to check the log file for the table names for
ANOVA and parameter estimates) and then save these two tables into SAS data using the following
commands ods output anova=anova_table; *where anova_table is the data set name you
created:
ods output ParameterEstimates=estimates;
Read the instructions again to see what it states and which tables should be displayed. You know the syntax so it's figuring out the instructions/tables now.
You get no output from the PROC REG because of the error in the log
94 proc reg data = drivingclass; 95 model drivingclass = Hours Score; ERROR: Variable DRIVINGCLASS not found.
Fix that, and you should be able to get the ANOVA output.
How do I go about fixing it?
What should be the model then?
@JoshuaG wrote:
What should be the model then?
Please read the log carefully. It is saying that it cannot find a variable named DRIVINGCLASS. The model has to contain variables that are actually in the data set.
I thought hours and score was in the data set? Do I need to change the left side of the equal sign? I am just stuck as to what I should put on the left side of the equal sign.
Once again, the variable you put in the code named DRIVINGCLASS is not in the data set. Therefore, you cannot use it.
I have no idea what variables are actually in the data set, so I cannot advise. You, however, can determine what variables are in the data set and determine which to use in the model. Since you have already done the PROC PRINT, you should look at that and see for yourself what variables are available, and determine where they go in the model.
The variables are Campus, Hours, and Score. However, Campus is not needed for what this question is asking for. Knowing this, what should I make the model line look like?
Here is the question that you were asked to work on:
"Run a regression model to test the relationship between class hour (independent variable) and performance score (dependent variable)."
I am completely lost, would it just be hours = score
You're close it would be
score=hours
ods select anova;
proc reg data = drivingclass;
model Hours = Score;
ods output anova= Analysis of Variance;
ods output ParameterEstimates= Parameter Estimates;
run;
@JoshuaG wrote:
I switched the variables around but it is still giving me this issue
It is giving you a different issue.
ods select anova;
proc reg data = drivingclass;
model Hours = Score;
ods output anova= Analysis of Variance;
ods output ParameterEstimates= Parameter Estimates;
run;
After ods output anova= you need to have a valid SAS data set name. Analysis of Variance is not a valid SAS data set name. Do you know why it is not a valid SAS data set name?
After ods output ParameterEstimtes= you need to have a valid SAS data set name. Parameter Estimates is not a valid SAS data set name.
Also, you still have hours and score in the wrong place.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.