Fitting Different Slopes Common InterceptsHi - i am unsure how to fit a regression model with different slopes BUT a common Interecpt.
Assume Y=response, GROUP (2-levels), TIme (Covariate)
Kind regards, Vince
Re: Fitting Different Slopes Common Interceptsthanks much appreciated.Re: Fitting Different Slopes Common InterceptsHere is another approach, using the Nonlinear platform. Attached is an example: you need to set parameters to be solved for, with a single intercept but varying slope parameters for the two groups. The script is saved for the solution.
Re: Fitting Different Slopes Common InterceptsThanks - so I assume fit model implementation is required to get the common intercept and slopes first then fit by x to get the figure. Thanks for your help . Appreciate itRe: Fitting Different Slopes Common InterceptsI copied it from fit model to @dale_lehman answer, instead of the zero he suggested or the 40 I initially guessed. If you start with fit model rather than fit y by x, you get parameters for both lines without copying the numbers.
Re: Fitting Different Slopes Common InterceptsThanks - how did you estimate the common intercept using fit y by x of 49?.Re: Fitting Different Slopes Common InterceptsFit model does give the intercept and the two slopes in a single step. The picture is comparing the easy-to-read output in fit y by x with the parameters returned by fit model. I puzzled it out by comparing them; I hope @Mark_Bailey is watching in case I've misinterpreted something.
Re: Fitting Different Slopes Common InterceptsThanks...curious to knnow if there is an alternative way without this to stage process..Re: Fitting Different Slopes Common InterceptsThansk...however when i adopt the below approach the graph of Y verus TIME by group - doesnt appear to haev a common intercept. Howevre if i change Time to an ordinal variable..seems to work OK.
Re: Fitting Different Slopes Common InterceptsThanks! I made up 40 because it looked good (better than zero, anyway).
edit: adding an image. Left is fit y by x, center is fit model. Right is illustrating how to get the slopes from fit model.
@Mark_Bailey
Getting the slopes from Fit ModelGetting the slopes from Fit ModelGetting the slopes from Fit Model
Re: Fitting Different Slopes Common InterceptsIf you also want to estimate the common intercept, try this approach.
- Select Analyze > Fit Model.
- Click the red triangle at the top left and de-select Center Polynomials.
- Select the response column and click Y.
- Select the time and group columns and click Macros, then select Factorial to Degree.
- Select the group effect and click Remove.
- JMP will ask you to if it should remove all terms with this column. Click No.
- Click Run.
- JMP will warn you about a missing effect. Click Continue.
In general, we would keep the group effect in the model to maintain the model hierarchy. But that leads to a unique or different intercept for each group. This way you will get estimates and tests for the common intercept and unique group slopes.
Re: Fitting Different Slopes Common Intercepts@dale_lehman Cool!
Male and Female groups have same interceptMale and Female groups have same interceptMale and Female groups have same intercept
Re: Fitting Different Slopes Common InterceptsYou can do this in Fit Y by X: Y=response, X=time. After the plot, Group by GROUP. Then use Fit Special and constrain the intercept to 0.