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
- /
- SAS Programming
- /
- General Programming
- /
- Logistic regression for continuous predictor

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

09-23-2014 03:24 PM

Standard logistic regression works for predict binary 0 & 1. Now I have a data set with predict value between 0 and 1, such as 0.2, 0.5, .... How can use logistic regression build a model out of it? thanks.

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

09-23-2014 03:42 PM

Your question is not clear. Please provide more info.

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

09-23-2014 03:50 PM

For example, I have a sample, which contains 100 pool information. there are some independent variables which are pool average characteristics, such as loan size, loan coupon. I have a predictor variable, which is a pool average of 0 and 1, so they 0.115, 0.234, .... I want to build a logistic regression model to predict (0.115, 0.234, ...) from pool average characteristics, such as pool average loan size etc. If the predictor are 90, 0, 1, 0, 1, 1, ..). Then it's easy to do. But for continuous variable, I can not use proc logistic to do it. Is there a way out? Thanks.

Jian

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

09-23-2014 03:58 PM

As your dependent variable is continuous so try proc reg instead of logistic regression.

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

09-23-2014 04:26 PM

proc reg is sum of each component, I want to do multiplying of each component. Thanks.

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

09-23-2014 07:42 PM

1. You can take the logarithm of variables, and create a model using those new variables.

2. If you want to model a proportion, maybe you could use PROC GENMOD with DIST=GAMMA

Do I understand correctly: individual data is not available, only aggregated?

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

09-24-2014 07:27 AM

1. logarithm is not a linear transformation, so optimal fit for logarithm of variables are not optimal fit for the variables themselves. I have proved this.

2. Can you explain more how to use DIST=GAMMA? Normally I use d=b.

Thanks.

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

09-24-2014 08:06 AM

1. You are right. But it also depends how you define "optimal", what are your model assumtions, and how you transform "back" your predicted variable (if you transformed the target variable)

2. Sorry, it is not GAMMA it is BETA. But beta distribution is not available in GENMOD.

So what about his?

proc glimmix data=input;

model target=x1 / d=beta;

run;

With GLIMMIX you might find the appropriate model you need (with, or without variable transformations).

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

09-24-2014 08:19 AM

For 1, what do you mean how your transform "back" your predicted variable? Is there more than 1 way to transform back? I just exp() it back.

Thanks.

Jian

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

09-24-2014 09:52 AM

When you transform predictions using exp(log_target) you will get the unbiased prediction of the **median** on the original scale.

To get an unbiased prediction of the **mean** on the original scale use: exp(log_target+0.5*std**2)

std is the prediction standard deviation.

This is true if your log transformed variable is (conditionally) normally disributed (the original variable is lognormal).

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

09-24-2014 10:22 AM

Hi Gergely,

Just to learn more about this a quick question, does exp(log_target) provide unbiased prediction of median or geometric mean?

Thanks,

Naeem

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

09-24-2014 10:48 AM

Unbiased estimation of the median.

On the log scale the prediction of the mean is the prediction of the median at the same time. (Remember, we have a normally distributed variable (on the log scale), which is a symetric distribution.)

Now, if you apply a **monotonic function** (like exp()) to the prediction... the median still sits in the middle of the distribution

I don't know what happens to the geometric mean.

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

09-24-2014 11:42 AM

Thanks - Just trying to understand this because when we exponent like exp(log_target) we end up with geometric mean.

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

09-25-2014 02:41 AM

stat@sas: I thought about it and you are right. In case of exp mean becomes the geometric mean (and also remains the median). Thx.

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

09-24-2014 10:23 AM

Cool. How can I get prediction standard deviation? From the model fit, I got the std of the fitted parameter, then how obtain predictor std base on this? thanks.