09-01-2015
disguy
Calcite | Level 5
Member since
06-07-2013
- 13 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by disguy
Subject Views Posted 8408 06-14-2013 10:13 PM 8408 06-14-2013 06:18 PM 9530 06-14-2013 05:31 PM 956 06-14-2013 03:46 PM 983 06-14-2013 03:37 PM 2142 06-13-2013 02:42 PM 2177 06-13-2013 01:26 PM 2177 06-13-2013 01:12 PM 2177 06-13-2013 01:00 PM 2313 06-13-2013 12:21 PM -
Activity Feed for disguy
- Posted Re: Proc GLM: How to do partial F test? on Statistical Procedures. 06-14-2013 10:13 PM
- Posted Re: Proc GLM: How to do partial F test? on Statistical Procedures. 06-14-2013 06:18 PM
- Posted Proc GLM: How to do partial F test? on Statistical Procedures. 06-14-2013 05:31 PM
- Posted Re: Scatterplot for Grouped Data on SAS Procedures. 06-14-2013 03:46 PM
- Posted Scatterplot for Grouped Data on SAS Procedures. 06-14-2013 03:37 PM
- Posted Re: Working with Indicator Variables on SAS Procedures. 06-13-2013 02:42 PM
- Liked Re: Working with Indicator Variables for data_null__. 06-13-2013 02:41 PM
- Posted Re: Working with Indicator Variables on SAS Procedures. 06-13-2013 01:26 PM
- Posted Re: Working with Indicator Variables on SAS Procedures. 06-13-2013 01:12 PM
- Posted Re: Working with Indicator Variables on SAS Procedures. 06-13-2013 01:00 PM
- Posted Working with Indicator Variables on SAS Procedures. 06-13-2013 12:21 PM
- Posted Re: Replacing Data Entries on SAS Procedures. 06-07-2013 11:02 PM
- Posted Re: Replacing Data Entries on SAS Procedures. 06-07-2013 09:48 PM
- Posted Replacing Data Entries on SAS Procedures. 06-07-2013 08:25 PM
-
Posts I Liked
Subject Likes Author Latest Post 2
06-14-2013
10:13 PM
Thanks. I've been a little confused, and I think it might stem from my understanding of the partial F test rather than how to use SAS. So I would like to clarify that I have the right approach: I used proc glm to get various sum of squares information to do a partial F test. Now, for testing the hypothesis that the slopes are all different, would it be correct to describe the model as: Let R be indicator variable with 3 levels. Y = B_0 + B_1 X + B_2 R + B_3 XR Then, I would test the hypothesis that B_1 = B_2 = B_3 by setting up the model Y = B_0 + B (X + R + (X)(R))? And finally, just use the sum of squares information where this becomes my reduced model?
... View more
06-14-2013
06:18 PM
The indicator (which has 3 levels here) is categorical, but the Y and X variables are numerical. What do contrast statements look like?
... View more
06-14-2013
05:31 PM
Suppose we have a regression model between two variables: Yvar and Xvar. Suppose the results are grouped in terms of a variable with 3 levels (say this variable is for race: asian, black, white). If I observe the scatterplot in terms of these groupings (using different colors) and I observe that all 3 have different slopes - how I do I test this using the proc glm procedure? That is, if I want to test that the slopes for Yvar and Xvar are different for each level of the race variable, how do I do this with proc glm? I'm pretty sure it involves partial F-tests, but I only have experience with those using the proc reg procedure. Thanks in advance.
... View more
06-14-2013
03:37 PM
I've been instructed to produce a scatterplot between a response and predictor, grouped by an indicator variable. I am supposed to have one scatterplot show the different levels of the indicator variable. I am using a limited, remote version of SAS - so there are some procedures I can't really use. I'm limited to using proc reg or proc gplot. This is what I have tried, but what it does it produce two separate scatterplots for each level of the indicator: goptions reset = all; symbol1 v=dot c=red h=1; symbol2 v=plus c=blue h=2; proc gplot data=datafile; plot Y*X; by ind; run; I have also tried: proc reg data=datafile; model Y = X; plot Y*X; by ind; run; I have tried other variations, and have also sorted by the indicator beforehand. Any help would be appreciated.
... View more
06-13-2013
01:26 PM
Ah, I see. Well my teacher explained that a lot of people use proc glm for everything, but they don't know what they're doing or what they're looking for since they don't know what it actually does unless you actually know what some of the lower-level code does. I'm assuming for indicator variables, when you have 4 levels, you want 3 indicators. So you basically want {1, 0, 0, 0} for 3 of them, and one with all 0's?
... View more
06-13-2013
01:12 PM
Correct, this is a homework question. I'm not very well-acquainted with SAS, so I'm not sure what you mean by assembler language.
... View more
06-13-2013
01:00 PM
I was told that I could not use proc glm. I'm supposed to get familiar with how to do things without it. So I'm trying to generalize the method I learned for categorical variables with 3 levels. I'm mainly limited to using proc reg.
... View more
06-13-2013
12:21 PM
Consider making an indicator variable for a predictor with 3 levels. Suppose the color variable can be red, blue, or white. select(color); when('red') do; i_Red = 1; i_Blue = 0; end; when('blue') do; i_Red = 0; i_Blue = 1; end; when('white') do; i_Red = 0; i_Blue = 0; end; If we had a fourth level, how would I generalize the above procedure? If we added the color purple, would I have to redo all the code to something along the lines of: when('purple') do; i_Purple = 1; i_Red = 0; i_Blue = 0; i_White = 0; end; And after I have successfully created an indicator variable, how do I go about calling it for a procedure? If I wanted to run the regression procedure, would it be something like: proc reg data = data_1; model y*color; when color = 'white' end; Thanks in advance.
... View more
06-07-2013
11:02 PM
Unfortunately, I am using a remote version of SAS and it really limits what I can do. This being the case, I can't view the results of proc contents. However, I have uploaded the data file to pastebin: http://http://pastebin.com/WLjLdPex The relevant variables are "force" (the one I referred to as "numerical") and "break" (the one I referred to as "categorical"). My instructions were to replace the "DQ" values with "." I will post the code I used to access the data remotely: data test; infile 'datafile.txt' firstobs=2 delimiter='09'x termstr=crlf; input btch$ glue$ clamp$ overlap$ stick color$ user$ jig caliper force break$ quality; drop btch user jig; run; When attempting to replace the DQ values, I inserted the code between the drop and run statements (if that matters).
... View more
06-07-2013
09:48 PM
Thanks for the reply. Unfortunately, it did not work (same issues as before). When the log lists the data values for each variable, it shows that the values have been changed to "." - as desired (and also as with the methods I listed in my original post). However, for multiple lines the log writes "NOTE: Invalid date for numerical in line XXX XX-XX". It seems to be doing this only for the numerical variable. EDIT: And if I'm not mistaken, it seems to only be outputting this error for observations where both the numerical and categorical variables have the entry "DQ".
... View more
06-07-2013
08:25 PM
Hello, I'm new to SAS and after doing a lot of searching, I can't seem to get some simple data operations to work. Given a dataset, I want to replace certain data entries systematically. My document contains several unwanted entries with the string "DQ" and I want to replace them in the data step with missing values ".". The problem is, I get errors and I suspect it has to do because the "DQ" entries are given for both numerical and categorical variables. I have tried three different approaches, and all of them have yielded errors that my data is invalid still. Note: when I used the 'replace all' function in notepad and ran the data, I had no "invalid data" problems. To show my approaches, let "categorical" and "numerical" be my variables. Approach #1: numerical = .; replace all var{numerical} where(numerical = "DQ); categorical = "."; replace all var{categorical} where(categorical = "DQ"); Approach #2: if numerical = "DQ" then numerical = .; if categorical = "DQ" then categorical = "."; Approach #3: numerical = tranwrd(numerical, "DQ", .); categorical=tranwrd(categorical, "DQ", "."); Is there something fundamentally wrong with my approach? Even though I distinguish between "." and . without quotations - I have not been able to successfully run the data. I run SAS remotely, so I cannot view the data from within the program; the log simply informs me of the errors. Thanks in advance.
... View more