I am trying to analyze a 2-way factorial RCBD using ANOVA. I have set a PROC IMPORT command from an excel file. One of the variables is Gas, of which Methane, Nitrous Oxide and Carbon Dioxide are options. I want to analyze the data by gas. I wanted to look at Methane first, so, folowing after the PROC IMPORT command i inserted:
data Jul14_1;
set import;
if Gas=Methane;
run;
This is followed by PROC SORT, PROC PRINT, and PROC ANOVA commands. Although the Log does not show any errors, the prinout does not include any statistical results just the input data. The log gives one comment in blue: "NOTE: Variable Methane is uninitialized." and anotoher in green: "WARNING: Data set WORK.JUL14_1 was not replaced because new file is incomplete."
How do i properly use a command for SAS to only analyze the methane data from the imported excel file?
Thanks
The error is here, SAS is looking for a variable Methane. If you're trying to specify a string, you enclose it in quotation marks.
"NOTE: Variable Methane is uninitialized."
if gas='Methane';
You can also implement the filter directly in your proc using a WHERE clause.
where gas='Methane';
Also, if you're going to do the same analysis for all gas types use a BY variable instead of filtering and running for each type.
Yup, that worked. Thanks.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.