Displaying 5 results from an estimated 5 matches for "terms2".
Did you mean:
terms
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
...t easier to correctly
> create the assign attribute.
>
> Can you create a worked example?
>
> require(survival)
> testfun <- function(formula, data) {
> tform <- terms(formula, specials="strata")
> mf <- model.frame(tform, data)
>
> terms2 <- terms(mf)
> strat <- untangle.specials(terms2, "strata")
> if (length(strat$terms)) terms2 <- terms2[-strat$terms]
> X <- model.matrix(terms2, mf)
> X
> }
>
> tdata <- data.frame(y= 1:10, zed = 1:10, grp =
> factor(c(1,1,1,2,2,...
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
...t easier to correctly
> create the assign attribute.
>
> Can you create a worked example?
>
> require(survival)
> testfun <- function(formula, data) {
> tform <- terms(formula, specials="strata")
> mf <- model.frame(tform, data)
>
> terms2 <- terms(mf)
> strat <- untangle.specials(terms2, "strata")
> if (length(strat$terms)) terms2 <- terms2[-strat$terms]
> X <- model.matrix(terms2, mf)
> X
> }
>
> tdata <- data.frame(y= 1:10, zed = 1:10, grp =
> factor(c(1,1,1,2,2,...
2009 Aug 19
2
Problem with predict.coxph
...0.36360168
20 -0.09492167
21 0.66554276
22 0.55748465
23 0.37596413
24 0.01612020
25 -0.03567735
>
The problem is that under R 2.8.1 and R 2.9.1 the previous line fails with the following error:
> totalut<-predict(mod1,newdata=newdata,type="lp")
Error in model.frame.default(Terms2, newdata, xlev = object$xlevels) :
variable lengths differ (found for 'Price')
In addition: Warning message:
'newdata' had 25 rows but variable(s) found have 43350 rows
Does anyone have an idea what is going on?
Best regards,
Michael Conklin
W. Michael Conklin
Chief Methodo...
2006 May 26
8
Comparing two documents in the index
I want to compare two documents in the index (i.e. retrieve the cosine
similarity/score between two documents term-vector''s). Is this possible
using the standard Ferret functionality?
Thanks in advance,
Jeroen Bulters
--
Posted via http://www.ruby-forum.com/.
2009 Apr 27
2
Problem with R 2.9.0 vs. R2.8.1 with either "survival" package or "predict" function
...on 24 df, p=0
Score (logrank) test = 164.0 on 24 df, p=0
Then, I run this line:
utilities<-predict(model,newdata=expand.grid(V1=factor(1:5),V2=factor(1:5)))
This line runs fine in R2.8.1 and gives me a vector of utilities.
But when I run it in R2.9.0, I get:
Error in model.frame.default(Terms2, newdata, xlev = object$xlevels) :
variable lengths differ (found for 'V1')
In addition: Warning message:
'newdata' had 25 rows but variable(s) found have 2415 rows
I prefer not to get into the debugging of that whole thing. But
thought that someone knowledgeable might get an ide...