Hi!

It seems the data file wasn't transmit. Please find a copy in attachment.

Best,

ge

On 11/19/2012 09:02 AM, Terry Therneau-2 [via R] wrote:
> I can't reproduce the problem.
> 
> Tell us what version of R and what version of the survival package.
> Create a reproducable example.  I don't know if some variables are
> numeric and some are
> factors, how/where the "surv" object was defined, etc.
> 
> Terry Therneau
> 
> 
> 
> On 11/17/2012 05:00 AM, [hidden email]
> </user/SendEmail.jtp?type=node&node=4650064&i=0> wrote:
> 
>> This works ok:
>>
>>> >  cox = coxph(surv ~ bucket*(today + accor + both) + activity, data
> = data)
>>> >  fit = survfit(cox, newdata=data[1:100,])
>> but using strata leads to problems:
>>
>>> >  cox.s = coxph(surv ~  bucket*(today + accor + both) +
> strata(activity),
>>> >  data = data)
>>> >  fit.s = survfit(cox.s, newdata=data[1:100,])
>> Error in model.frame.default(data = data[1:100, ], formula = ~bucket +  :
>>    number of variables != number of variable names
>>
>> Note that the following give rise to the same error:
>>
>>> >  fit.s = survfit(cox.s, newdata=data)
>> Error in model.frame.default(data = data, formula = ~bucket + today +  :
>>    number of variables != number of variable names
>>
>> but if I use data implicitly, all is working fine:
>>> >  fit.s = survfit(cox.s)
>> Any idea on how I could solve this?
>>
>> Best, and thank you,
>>
>> ge
> 
> ______________________________________________
> [hidden email] </user/SendEmail.jtp?type=node&node=4650064&i=1> mailing
> list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://r.789695.n4.nabble.com/survfit-number-of-variables-number-of-variable-names-tp4649834p4650064.html
> 
> To unsubscribe from survfit & number of variables != number of variable
> names, click here
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4649834&code=Z2Vvcmdlcy5kdXByZXRAeWFob28uZnJ8NDY0OTgzNHwtODc0NjQ3MDY=>.
> NAML
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> 


small.csv.gz (1K) <http://r.789695.n4.nabble.com/attachment/4650122/0/small.csv.gz>




--
View this message in context: http://r.789695.n4.nabble.com/survfit-number-of-variables-number-of-variable-names-tp4649834p4650122.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]


