Hi there,
I am working on a project for school, and I am by no means an expert. For every assignment, but this one, we have been given a dataset. So, this is the first time choosing my own.
As, I run Summary Statistics and try to add Analysis Variables it states "no columns are available." It does the same when I try to add a dependent variable for linear regression.
Here is the code for my data set??
As, I run Summary Statistics and try to add Analysis Variables it states "no columns are available." It does the same when I try to add a dependent variable for linear regression.
You have NOT shown us anything like this in the LOG. Show us the LOG for this part of the code.
I copied my entire log for the data set. As I stated, I am very new to SAS and am completing this for a school project. Could you be more specific of what I need to show you and where I can find it?
You said you ran summary statistics, but no LOG from that action is shown. You said you were trying a linear regression, but no LOG from that action is shown.
I stated I TRIED to run summary statistics and linear regression, but I was unable to add analysis variables and dependent variables.
And how did you TRY to run these analyses?
I clicked on them to run them, chose my data set, and clicked to add the variables... but no variables are available.
Can you show us a screen capture of the error message? Click on the "Insert Photos" icon to include screen captures in your reply.
My guess is that your data set was read (perhaps incorrectly) and has no numeric variables, these are all character variables, and so Summarize Data and Linear Regression are not valid methods of analyzing character variables.
The output from PROC CONTENTS will show you whether that is the case or not.
The rather funny column names let me think that all these variables contain textual data (of type character), which can't be used for the analysis you plan.
To verify this, post the output (not the code, not the log) of a PROC CONTENTS of the dataset.
I will only be using two of the 27 columns.
This is what they look like.
Is it possible to change one to numeric?
Pecan Pie | US Region |
2 | Yes | West South Central |
3 | No | West South Central |
4 | No | West South Central |
5 | Yes | West South Central |
6 | Yes | West South Central |
7 | No | West South Central |
8 | Yes | West South Central |
9 | Yes | West South Central |
10 | Yes | West South Central |
11 | Yes | West South Central |
12 | No | West South Central |
13 | Yes | West South Central |
14 | Yes | West South Central |
15 | No | West South Central |
16 | No | West South Central |
17 | Yes | West South Central |
18 | Yes | West South Central |
19 | No | West South Central |
20 | Yes | West South Central |
21 | Yes | West South Central |
22 | No | West South Central |
23 | Yes | West South Central |
24 | No | West South Central |
25 | Yes | West South Central |
26 | Yes | West South Central |
27 | Yes | West South Central |
28 | Yes | West South Central |
29 | Yes | West South Central |
30 | Yes | West South Central |
31 | Yes | West South Central |
32 | Yes | West South Central |
33 | No | West South Central |
34 | Yes | West South Central |
35 | Yes | West South Central |
36 | Yes | West South Central |
37 | No | West South Central |
38 | Yes | West South Central |
39 | No | West South Central |
40 | Yes | West South Central |
41 | Yes | West South Central |
42 | No | West South Central |
43 | Yes | West South Central |
44 | Yes | West South Central |
45 | No | West South Central |
46 | No | West South Central |
47 | No | West South Central |
48 | Yes | West South Central |
49 | Yes | West South Central |
50 | Yes | West South Central |
51 | Yes | West South Central |
52 | No | West South Central |
53 | Yes | West South Central |
54 | No | West South Central |
55 | No | West South Central |
56 | Yes | West South Central |
57 | No | West South Central |
58 | Yes | West South Central |
59 | Yes | West South Central |
60 | Yes | West South Central |
61 | No | West South Central |
62 | Yes | West South Central |
63 | Yes | West South Central |
64 | No | West South Central |
65 | No | West South Central |
66 | Yes | West South Central |
67 | Yes | West South Central |
68 | No | West South Central |
69 | No | West South Central |
70 | Yes | West South Central |
71 | No | West South Central |
72 | No | West South Central |
73 | Yes | West South Central |
74 | No | West South Central |
75 | No | West South Central |
76 | No | West South Central |
77 | Yes | West South Central |
78 | Yes | West South Central |
79 | No | West South Central |
80 | No | West South Central |
81 | Yes | West South Central |
82 | Yes | West South Central |
83 | Yes | West South Central |
84 | Yes | West South Central |
85 | Yes | West South Central |
86 | No | West North Central |
87 | No | West North Central |
88 | No | West North Central |
89 | No | West North Central |
90 | Yes | West North Central |
91 | Yes | West North Central |
92 | No | West North Central |
93 | Yes | West North Central |
94 | No | West North Central |
95 | No | West North Central |
96 | Yes | West North Central |
97 | No | West North Central |
98 | No | West North Central |
99 | No | West North Central |
100 | No | West North Central |
You can replace the Yes/No column with a new column that has 1 (true) for Yes and 0 (false) for No.
pecan = ifn('Pecan Pie'n = "Yes",1,0);
I will only be using two of the 27 columns.
This is what they look like.
Is it possible to change one to numeric?
Pecan Pie US Region
2 Yes West South Central
3 No West South Central
Let's stop here, and ask questions that have nothing to do with SAS, but are directly related to your desire to run summary statistics or a regression on this data.
Does it make even the slightest bit of sense to change either variable to numeric? Explain.
Again, this has nothing to do with SAS. How would you define the summary statistics of "US Region"? How would you do a regression with "US Region"? How would you define the mean of "Yes" or "No"??
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.