BookmarkSubscribeRSS Feed
sysmars
Calcite | Level 5

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

7 REPLIES 7
Lida
Obsidian | Level 7

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.

sysmars
Calcite | Level 5

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.

Reeza
Super User

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

sysmars
Calcite | Level 5

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

SteveDenham
Jade | Level 19

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

sysmars
Calcite | Level 5

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.

SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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