ASA Connect

 View Only
  • 1.  Help with Non-Linear JMP?

    Posted 02-08-2016 09:54

    I would like to specify a non-linear model in JMP and allow different coefficients for different treatments.

                   That is the only statistical software available to me.

     

    The linear analog would be (something like): Y = TREATMENT, SLOPE, TREATMENT*SLOPE

                   This model will fit overall INTERCEPT and SLOPE, and deviations from those for each TREATMENT.

                   In effect, each TREATMENT will have its own INTERCEPT and SLOPE.

                   Variations on this are: Y = TREATMENT, SLOPE (where each TREATMENT has its own INTERCEPT, but they all have the same SLOPE), etc.

     

    I am fitting the model: Y = A + B[1-EXP(-x/C)]

                   And I (might) want each of the treatments to have their own A, B, C

                   Depending on the fit and the regression diagnostics, I may decide they can share one or more of the parameters – that's what I'm trying to find out.

     

    In the past, I brute-forced this situation by fitting the model BY TREATMENT, and later re-combining, but now my dataset is too big for that.

     

    I appreciate any advice you might have.

     

    Thank you.

     

     

     

    Regards,

     

    Fred W. Girshick

     

    This note may contain Infineum confidential information. If you are an unintended recipient, (i) place no reliance on the information contained herein, (ii) do not disclose, distribute, or duplicate any information from this note, and (iii) please contact the author.

    ________________________________________

     



  • 2.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 00:12

    Dear Fred,

    "That is the only software available to me."

    R is available too, for free.www.r-project.org" target="_blank"> www.r-project.org.

    I too, am interested in replies to this question as I also have jmp. Not yet sure how to fit mixed models with it. 

    Sincerely, 

    KeithC. 

    ------------------------------
    Keith Chamberlain
    Analytical Chemist



  • 3.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 01:58

    Fred-

    Excellent question that I have also struggled with in the past.  I worked around this in the past by using the By variable or writing a script.  But when I re-visited your question today I found a new feature in the JMP Non-Linear package that may help.  It is called Fit Curve.  It seems to be set up for this situation where you want to compare the parameters and fits across groups.  instead of using the By variable you would use the Group variable.  And instead of putting in the predictor formula just enter in the X column.  Then when after running you will see the red triangle under Fit Curve which will allow you to select a model from the JMP library.  I could not see how to put in a custom model but fortunately your model is equivalent mathematically to the Mechanistic Growth model under Exponential Growth and Decay.  So you can translate the parameters back later if you like.  After selecting the model you will have all the usual options for saving the prediction and residual formulas, creating a table of parameter estimates, plus a whole bunch of cool options for comparing parameters across groups etc.

    -Walt

    ------------------------------
    Walter Flom



  • 4.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 02:49

    Hey Fred,

    How are you fitting an interaction model for this data?

    What type of data are you fitting? 

    Either way, the function looks like it could be a reliability curve or survival analysis. Have you tried either of those options?

    Are you familiar with Cox models for survival analysis? 

    On my copy of JMP, select Analyze>Modeling>Non-linear. Then you can go through a series of options for the correct function.  

    Looking at your model as:

    Y = A+B{1-exp^-xC)

    can be expanded to be:

    Y = A + B -Bexp^-xC => (A+B) - Bexp^-xC => D - Bexp^-xC

    Depending upon how you set up an interaction term in this model, the term 'D' could change for each type of treatment or 'C' could be the thing that changes.

    ------------------------------
    Andrew Ekstrom



  • 5.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 03:27
    Hi Fred,
    there are several ways to parameterize and several to code this.

    A GUI user would open the "Nonlinear" dialogue window and klick on
    [Model Library],
    chose "First-order Deacay Kinetics", klick on [Make Formula]
    assign Y, X, and Group variables y, x, group and the comparison group
    (here: "c").
    After a klick on [Make Formula] in the starting values selection window
    a new table column would contain the fomula (with other numbers)
    Parameter(
    {theta1_a = 0.1, theta1_b = 0.1, theta1 = 1,
    theta2_a = 0.1, theta2_b = 0.1, theta2 = -1,
    theta3_a = 0.1, theta3_b = 0.1, theta3 = 1},
    (theta1 + theta1_a * (:group == "a") + theta1_b * (:group == "b"))* Exp(
    -(theta2 + theta2_a * (:group == "a") + theta2_b * (:group == "b")) *
    :x) +
    (theta3 + theta3_a * (:group == "a") + theta3_b * (:group ==
    "b"))
    )
    You might want to enter your formula via the column properties,
    define Parameters A, B, C with
    [x] expand into categories, selecting column (here: group)
    and enter the formula as usual with the result:
    Parameter(
    {A_group_a = 1, A_group_b = 1, A_group_c = 1,
    B_group_a = 1, B_group_b = 1, B_group_c = 1,
    C_group_a = 1, C_group_b = 1, C_group_c = 1},
    Match( :group, "a", A_group_a, "b", A_group_b, "c", A_group_c ) +
    Match( :group, "a", B_group_a, "b", B_group_b, "c", B_group_c ) * (1
    - Exp( - :x /
    Match( :group, "a", C_group_a, "b", C_group_b, "c", C_group_c)
    ) )
    )
    To switch from dummy coding (reference group "c") to effect coding, as
    used in the linear model prediction formula, change to
    Parameter(
    {A = 1, A_a = 1, A_b = 1,
    B = 1, B_a = 1, B_b = 1,
    C = 1, C_a = 1, C_b = 1},
    (A + Match( :group, "a", A_a, "b", A_b, "c", -A_a - A_b ))+
    (B + Match( :group, "a", B_a, "b", B_b, "c", -B_a - B_b )) * (1 -
    Exp( - :x /
    (C + Match( :group, "a", C_a, "b", C_b, "c", -C_a - C_b))
    ) )
    )
    For a shared Parameter C, you could delete the last Match() from the
    formula.
    I'd advise to instead chose "Remember Solution" from the red triangle,
    use the report window options
    Parameter Current Value Lock
    C_a 0 [x]
    C_b 0 [x]
    and "Remember Solution" again, so you get the test, if these parameters
    are equal across groups.

    Reinhard Vonthein

    ------Original Message------

    I would like to specify a non-linear model in JMP and allow different coefficients for different treatments.

                   That is the only statistical software available to me.

     

    The linear analog would be (something like): Y = TREATMENT, SLOPE, TREATMENT*SLOPE

                   This model will fit overall INTERCEPT and SLOPE, and deviations from those for each TREATMENT.

                   In effect, each TREATMENT will have its own INTERCEPT and SLOPE.

                   Variations on this are: Y = TREATMENT, SLOPE (where each TREATMENT has its own INTERCEPT, but they all have the same SLOPE), etc.

     

    I am fitting the model: Y = A + B[1-EXP(-x/C)]

                   And I (might) want each of the treatments to have their own A, B, C

                   Depending on the fit and the regression diagnostics, I may decide they can share one or more of the parameters – that's what I'm trying to find out.

     

    In the past, I brute-forced this situation by fitting the model BY TREATMENT, and later re-combining, but now my dataset is too big for that.

     

    I appreciate any advice you might have.

     

    Thank you.

     

     

     

    Regards,

     

    Fred W. Girshick

     

    This note may contain Infineum confidential information. If you are an unintended recipient, (i) place no reliance on the information contained herein, (ii) do not disclose, distribute, or duplicate any information from this note, and (iii) please contact the author.

    ________________________________________

     



  • 6.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 09:43

    Hi, all.

    While I am no expert on the JMP non-linear platform, for future questions or other resources for JMP, please check out the user community at https://community.jmp.com/welcome.

    Cheers,

    Richard

    ------------------------------
    Richard Zink
    Principal Research Statistician Developer
    JMP Life Sciences
    SAS Institute, Inc.



  • 7.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 14:16
    Perhaps you might also pose your questions at the SAS JMP Community Internet site:

    https://community.jmp.com/welcome

    ------Original Message------

    I would like to specify a non-linear model in JMP and allow different coefficients for different treatments.

                   That is the only statistical software available to me.

     

    The linear analog would be (something like): Y = TREATMENT, SLOPE, TREATMENT*SLOPE

                   This model will fit overall INTERCEPT and SLOPE, and deviations from those for each TREATMENT.

                   In effect, each TREATMENT will have its own INTERCEPT and SLOPE.

                   Variations on this are: Y = TREATMENT, SLOPE (where each TREATMENT has its own INTERCEPT, but they all have the same SLOPE), etc.

     

    I am fitting the model: Y = A + B[1-EXP(-x/C)]

                   And I (might) want each of the treatments to have their own A, B, C

                   Depending on the fit and the regression diagnostics, I may decide they can share one or more of the parameters – that's what I'm trying to find out.

     

    In the past, I brute-forced this situation by fitting the model BY TREATMENT, and later re-combining, but now my dataset is too big for that.

     

    I appreciate any advice you might have.

     

    Thank you.

     

     

     

    Regards,

     

    Fred W. Girshick

     

    This note may contain Infineum confidential information. If you are an unintended recipient, (i) place no reliance on the information contained herein, (ii) do not disclose, distribute, or duplicate any information from this note, and (iii) please contact the author.

    ________________________________________

     



  • 8.  RE: Help with Non-Linear JMP?

    Posted 02-09-2016 14:47

    Fred,

    If I'm understanding you correctly, you can reach your objective by creating indicator functions for each treatment using if/else statements by creating a model formula, i.e.

    [the statements below are not true JMP syntax but I think you'll get the idea...]

    if treatment=="ctrl" then model=A1 + B1[1-EXP(-x/C1)];

    else if treatment=="T1" then model=A2+B2[1--EXP(-x/C2)];

    else if treatment=="T2" etc. etc.

    Then you can create a competing model by sharing parameters, [e.g. see below, the same A parameter for the first two treatments but different B and C parameters] and then compare a "full" model vs. the reduced models that share parameters.

    if treatment=="ctrl" then model=A1 + B1[1-EXP(-x/C1)];

    else if treatment=="T1" then model=A1+B2[1--EXP(-x/C2)];

    else if treatment=="T2" etc. etc.

    ------------------------------
    Todd Coffey
    Associate Director
    Center for Interdisciplinary Statistical Education and Research
    Washington State University



  • 9.  RE: Help with Non-Linear JMP?

    Posted 07-29-2016 11:13

    It's been a while since my original question, and I received several helpful suggestions.  I thought you might want to know what happened and how it turned out:

    I was given a dataset with approximately 35,000 records with four independent variables (5 x 2 x 3 = 30 "cases," and time) and nine dependent variables.  I have very often addressed the same situation with a single "case," and occasionally two or three, but never 30.  And never with so many records - I'm used to small datasets (less than 20 - 30 measurements).  (In my business, a data point can sometimes cost $100,000 or more).

    The model for time-dependence is Y = A + B[1-exp(-t/C)], where Y is the response, t is time, and A,B,C are the fitted parameters.
    In this case, I wanted to compare the fitted parameters (mostly B) across the "cases."  Also note, "A" should be the same for all.

    I suppose I could have fitted each of the 30 cases separately (for each of the nine responses = 270 fits), but that seemed inefficient and "wrong."  I was thinking of the analogous linear case, where the model can have interaction terms, which are very simply specified in software such as SAS or JMP: Y = X, T, X*T.  I wanted the non-linear equivalent of "X*T."

    In the end, I went with Indicator Variables (17 of them!), so "B" became "B0 + B1*I1 + B2*I2 + ....), and similar for "C."

    I had some fits and starts implementing this in JMP, which resulted in getting pretty adept at entering these models.
    My co-authors were thrilled with the results and the methodology (even though the main effect of interest is not significant).
    The paper will be presented at a Conference in October and published in the Proceedings.

    Thanks again for having a forum to share ideas and ask questions, and particular thanks to our colleagues who donate their time and experience to help others.

    P.S. In response to the suggestion to download free software: 1. I didn't really want to learn another programming language (but I would if I had to), and 2. My company does not allow downloading "unauthorised" software (and it's a bureaucratic nightmare to get authorization)..

    ------------------------------
    Fred Girshick



  • 10.  RE: Help with Non-Linear JMP?

    Posted 08-01-2016 09:52
    Fred,

    JMP Technical support (support@jmp.com) is always a good resource for questions like this.  

    It depends on which version of JMP that you have.  In older versions, you had to specific the parameterized non-linear model as an equation in a column in the JMP data table.  To have different coefficients based on a categorical variable, and easier way to do that is to, when adding the parameters, is the check the "Expand into categories, selecting column" for the parameter.  A dialog will prompt you to choose the categorical variable, and then multiple parameters are included as a "single" parameter that you can add to the model.  Essentially, what that does is create a conditional expression using the Match() function, with a different parameter.   It's one of the most complicated thing to set-up correctly in JMP, though.   

    In newer version of JMP you can use the "Fit Curve" platform (http://www.jmp.com/support/help/Nonlinear_Regression_with_Built-In_Models.shtml), which is simpler, you just launch the Non-linear platorm, specify your Y and X and grouping variables, click the "Ok" button,  and then you are launched into the "Fit Curve" platform, where you can fit a variety of built-in non-linear models.  For your model, if you create a X*= "1/X" variable in the data table, they use Y, X*, group in the dialog, and fit the "Exponential 3P" model, it should work.

    Sam Gardner




    ------Original Message------

    It's been a while since my original question, and I received several helpful suggestions.  I thought you might want to know what happened and how it turned out:

    I was given a dataset with approximately 35,000 records with four independent variables (5 x 2 x 3 = 30 "cases," and time) and nine dependent variables.  I have very often addressed the same situation with a single "case," and occasionally two or three, but never 30.  And never with so many records - I'm used to small datasets (less than 20 - 30 measurements).  (In my business, a data point can sometimes cost $100,000 or more).

    The model for time-dependence is Y = A + B[1-exp(-t/C)], where Y is the response, t is time, and A,B,C are the fitted parameters.
    In this case, I wanted to compare the fitted parameters (mostly B) across the "cases."  Also note, "A" should be the same for all.

    I suppose I could have fitted each of the 30 cases separately (for each of the nine responses = 270 fits), but that seemed inefficient and "wrong."  I was thinking of the analogous linear case, where the model can have interaction terms, which are very simply specified in software such as SAS or JMP: Y = X, T, X*T.  I wanted the non-linear equivalent of "X*T."

    In the end, I went with Indicator Variables (17 of them!), so "B" became "B0 + B1*I1 + B2*I2 + ....), and similar for "C."

    I had some fits and starts implementing this in JMP, which resulted in getting pretty adept at entering these models.
    My co-authors were thrilled with the results and the methodology (even though the main effect of interest is not significant).
    The paper will be presented at a Conference in October and published in the Proceedings.

    Thanks again for having a forum to share ideas and ask questions, and particular thanks to our colleagues who donate their time and experience to help others.

    P.S. In response to the suggestion to download free software: 1. I didn't really want to learn another programming language (but I would if I had to), and 2. My company does not allow downloading "unauthorised" software (and it's a bureaucratic nightmare to get authorization)..

    ------------------------------
    Fred Girshick
    ------------------------------