Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

Re: st: Spline after Cox regression

 From Etan Lakam To statalist@hsphsun2.harvard.edu Subject Re: st: Spline after Cox regression Date Wed, 10 Jul 2013 22:53:06 -0500

```Hi,
I have tried the mvrs instead to do the spline regression.
It works  but I have no clue on how to draw the relationship between
lnffa and the log hazard ratio,  after the regression, including the
95%CI around the curve.
Many thanks
Etan

On Tue, Jul 9, 2013 at 4:24 PM, Etan Lakam <etan.lakam@googlemail.com> wrote:
> Thanks, will try it and let you know.
> Etan
>
> On Tue, Jul 9, 2013 at 1:24 PM, Nick Cox <njcoxstata@gmail.com> wrote:
>> I was explaining the error message, not commenting on your strategy.
>> Perhaps you should look at -margins- and -marginsplot-.
>> Nick
>> njcoxstata@gmail.com
>>
>>
>> On 9 July 2013 15:27, Etan Lakam <etan.lakam@googlemail.com> wrote:
>>> How do I circumvent this problem then?
>>> Etan
>>>
>>> On Sun, Jul 7, 2013 at 2:19 AM, Nick Cox <njcoxstata@gmail.com> wrote:
>>>> So, -adjust- is evidently objecting to being asked to do something 1064
>>>> times.
>>>>
>>>> Nick
>>>> njcoxstata@gmail.com
>>>>
>>>> Etan Lakam
>>>>
>>>>> Yes lnffa is the variable I intended to use, it  has 1064 distinct
>>>>> values.
>>>>
>>>> Nick Cox
>>>>
>>>>>>> How many distinct values does -lnffa- have? Was that the variable
>>>>>>> you
>>>>>>> meant to use?
>>>>
>>>> Etan Lakam
>>>>
>>>>>>> > I am doing Cox-regression with a continuous exposure ffa and the
>>>>>>> > outcome hf, I have been trying to model it as  cubic spline.
>>>>>>> > Here is how I approached it, adjusting for age, sex, and race,
>>>>>>> > however
>>>>>>> > it is coming up with the message error below, and I cannot obtain
>>>>>>> > the
>>>>>>> > graph
>>>>>>> > I do not have a clue about what is happening.
>>>>
>>>>>>> > mkspline  rlnffa= lffa, cubic nknots(5)
>>>>>>> > stcox rlnratio* sex race age
>>>>>>> > adjust race=0 sex=1 age, by(lnffa) ci replace exp
>>>>>>> >
>>>>>>> >
>>>>>>> > ------------------------------------------------------------------------------------------
>>>>>>> >      Dependent variable: _t     Command: stcox
>>>>>>> >    Variables left as is: rlnffa1, rlnffa2
>>>>>>> >   Covariate set to mean: age = 53.900191
>>>>>>> > Covariates set to value: race = 0, sex = 1
>>>>>>> >
>>>>>>> >
>>>>>>> > ------------------------------------------------------------------------------------------
>>>>>>> > too many values
>>>>>>> > r(134);
>>>> *
>>>> *   For searches and help try:
>>>> *   http://www.stata.com/help.cgi?search
>>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>>> *   http://www.ats.ucla.edu/stat/stata/
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```