## Help on logistics regression

Occasional Contributor
Posts: 6

# Help on logistics regression

I have two groups data, group 1 and 0. I red that my data fit the equation of Y=1/[1+A*exp(B*X)] from literature. but i don't know how to compare the difference between this two group.

it is said that we can compare the coefficient A and B, who can help me, I attached my data. Really appreciate!D

Contributor
Posts: 42

## Re: Help on logistics regression

Hi,

It would be helpful if you describe your data. What is your response variable? Do you want to explain the variation in the response variable by the fact that the data come from two different groups? The equation for logistic regression is logit(Y)=βX, where Y is the response (independent) variable and X is the vector of the explanatory variables. The exp(β) produces the odds ratio (OR). By looking at OR you will be able to conclude what group is more (or less) likely to explain the variation in the response variable. I am not sure if this is your goal.

Occasional Contributor
Posts: 6

## Re: Help on logistics regression

Thanks, Lida

Maybe I need to verify the title.

For my data. the independent variable is X, and dependent variable is Y. From literature, the fitting equation for my data is Y=1/[1+A*exp(B*X)], I just want to compare the difference of two group, in my data, that's group 1 and 2. Actually, I am not sure whether my data is logistics regression, but, from the fitting equation, I thought it was. thank you very much.

Super User
Posts: 23,778

## Re: Help on logistics regression

I suggest reading some examples and trying to determine how it relates to your data.

http://www.ats.ucla.edu/stat/sas/dae/logit.htm

Occasional Contributor
Posts: 6

## Re: Help on logistics regression

thank you Reeza, I described my data again, could you help me to check whether I can use the procedure from UCLA?

Posts: 2,655

## Re: Help on logistics regression

It appears that your dependent variable is continuous, not binary as would be expected for logistic regression using PROC LOGISTIC.  I believe you may want to fit a logistic curve to your results, or at least some other S shaped curve.  You have repeated measures on subjects over time, and two groups.  I believe your best option would be something like PROC NLIN or PROC NLMIXED.

In particular you may wish to closely pattern your analysis after Example 63.5 Comparing Nonlinear Trends among Groups, in the NLIN Procedure documentation.  It fits a more complex model, but the techniques for group comparison are directly applicable to your data.  However, you do have the complicating factor of subject, providing an additional source of variability.  You may be able to adapt Example 64.5 Failure Time and Frailty Model in the NLMIXED documentation.  This example has groups and individuals, and it will be mostly a matter of converting the programming to the model you wish to fit.

Best of luck.

Steve Denham

Occasional Contributor
Posts: 6

## Re: Help on logistics regression

Thanks a lot, SteveDenham.

after I read the example you suggest, I am bewildered by the procedure metioned in 63.5, because I am only a beginner of SAS. I wonder if you can help write a procedure for my data, i know it need a lot of time to do it. But, i really need your help, I have been confused by these data for a couple of months, thanks so much.

Posts: 2,655

## Re: Help on logistics regression

All right.  But this may seem daunting for a beginner.  First of all, the equation form needs to be rewritten.  Currently, it forces the response variable to be less than or equal to 1.  Since there is adequate information that the response variable can be greater than 1, a new asymptotic value needs to be introduced, so that the equational form is Y=C/[1+A*exp(B*X)].  This fits for 14 subjects (seven in each group).  My preliminary analysis shows no differences due to group.

data yourdata1;
set yourdata;
x=X__FTSW_;
y=Y__NTR_;
subjid=sample_index+10*group;
run;

proc sort data=yourdata1;
by subjid ;
run;

proc nlmixed data=yourdata1  tech=trureg absfconv=1e-6 maxfunc=1000 maxiter=200;
*parms a_1=0.2 b_1=0 c_1=1 a_2=0.2 b_2=0 c_2=1 s2a=0.1 cab=0 s2b=0.1 cac=0 cbc=0 s2c=0.1 s2=0.5; /*Commented out, as the default values seem to work better than my quick inspection values*/
if (group=1) then do;
a = a_1;
b = b_1;
c = c_1;
end; else do;
a = a_2;
b = b_2;
c = c_2;
end;
aa=a + arand;
bb=b + brand;
cc=c + crand;
pred=cc/(1 + aa * exp (bb * x));
model y ~ normal(pred,s2);
random arand brand crand~ normal([0,0,0],[s2a,cab,s2b,cac,cbc,s2c]) subject=subjid;
run;

Steve Denham

Discussion stats
• 7 replies
• 535 views
• 1 like
• 4 in conversation