turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Regression

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2016 03:41 PM

I want to apply regression analysis by following way.

leverage=a+family+tangibility+market+sales+profit+e

here i want to analyze the leverage on family firms. family is a binary variable it has value 0 and 1, while other are control variables.

can anyone guide?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2016 03:48 PM

What's your question?

Here's a tutorial on regression with SAS

http://www.ats.ucla.edu/stat/sas/webbooks/reg/chapter1/sasreg1.htm

And here are a list of topics/tutorials on SAS topcis. The first SAS course in data analysis, which includes regression is free, see the bottom right hand side of the page.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2016 03:50 PM

I assume your question is "Wht procedure do I use?"

Try PROC LOGISTIC. The basic syntax is

proc logistic data=Have;

model leverage = family tangibility market sales profit;

run;

If any of those variable are discrete classification variables, put them on a CLASS statement, like this:

class family;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2016 04:07 PM

yes right.

my data also contain country name. what to add to get results for each country?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2016 04:12 PM

Reeza linked to several resources, which I hope you will find time to watch or read. Simples questions like this are covered in the examples and in the syntax section for PROC LOGISTIC.

To get an analysis for each unique country name, you can sort the data by country and use the BY statement:

BY CountryName;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-18-2016 11:46 AM

When i applied this regression

proc logistic data=have;

model bdr = fam tang MTB size prof;

class fam;

by count;

run;

Than i got this error. how to handle this?

ERROR: Variable F should be either numeric or specified in the CLASS statement

I want to get country wise results. and fam is the dummy variable having value 0 and 1

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-18-2016 02:19 PM

What values do the variable BDR take on?

Please post your log, your error doesn't align with the code you've posted and we'd just be guessing at what the issue might be.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-18-2016 02:29 PM

I have again attached the file.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-18-2016 02:32 PM

You don't need logistic regression, you need a regression model, try PROC GLM. Your dependent variable is continuous not binary, logistic regression is intended for variables that take a binary outcome.

If you get errors please post your log, otherwise we can't tell where you went wrong. As I mentioned above, your error doesn't match your code.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:07 AM

i have applied following regression everytime same error. i have pasted my log over here. please take a look. i have applied regression by putting class fam and also without putting class fam, both time same error.

proc glm data=d9;

model bdr = fam tang MTB size prof;

class fam;

by count;

run;

275 *logistic regression;

276 proc glm data=d9;

277

278 model bdr = fam tang MTB size prof;

ERROR: Variable Fam should be either numeric or specified in the CLASS statement.

NOTE: The previous statement has been deleted.

279 class fam;

280 by count;

281

282 run;

NOTE: Interactivity disabled with BY processing.

NOTE: PROCEDURE GLM used (Total process time):

real time 0.01 seconds

cpu time 0.01 seconds

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:11 AM

The log is clear. The variable FAM is a character variable but it's being included as a continuous variable. Convert it to numeric if it's a number or include it in the Class statement if it's a categorical variable.

Proc glm is one of the few Procs that requires a quit at the end, in addition to the run statement.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:17 AM

but in table i have seen fam has values 0 or 1.

how to delete fam values if they are other than 0 or 1.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:29 AM

Run a proc contents on the dataset to see variable type.

Run a proc freq to see what values your variable contains.

```
Proc contents data=mydata;
Run;
Proc freq data= mydata;
Table FAM;
Run;
```

data converted;

set mydata;

fam_num = input(fam, 2.);

run;

Numbers can be stored in a character variable.

Also, if it's 0/1 you can treat it as a categorical variable and include it in the Class statement.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:37 AM

here is the frequency of fam. it contains value 0 and 1 but its types says that it is a character variable. i dont know how to run regression if it is so.

Fam | ||||
---|---|---|---|---|

Fam | Frequency | Percent | Cumulative Frequency |
Cumulative Percent |

0 | 119807 | 94.31 | 119807 | 94.31 |

1 | 7234 | 5.69 | 127041 | 100.00 |

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2016 01:57 AM

Reeza wrote:

Also, if it's 0/1 you can treat it as a categorical variable and include it in the Class statement.

Let me repeat myself.

Also, the code sample above demonstrated how to convert it to numeric.

Heres a SAS that explains it as well.

http://support.sas.com/kb/24/590.html