[R] mob(party) formula question (example)

Birgitle birgit.lemcke at systbot.uzh.ch
Wed Aug 13 13:58:47 CEST 2008


Here is an example that produces the same error:

Read in the following as textfile (save as DFExample.txt):

	1	2	3	4	7	8	9	10	12	13	14	15	16	17	18	19	21	22	23	25	27	28	29	30	31	33	34
35	36	37	38	39	40	41	42	43	44	45	46	47	48	49	50	51	52	53	54	55	56	58	59	60
61	62	63	64	65	66	67	68	69	70	71	72	73	74	75	76	77	78	79	80
AX	1	1	0	0	1	0	0	1	0	0	0	0	0	0	0	1	0	1	0	0	1	1	0	0	0	0	0	1	0	0	0	1	0	0	0	0	0
1	0	0	0	0	0	0	0	0	0	1	1	0	0	1	0	1	25	5	9	1	8.5	2.5	3	5	2	2	3	3	1	1	1	2	1	2
BX	1	1	0	0	1	0	0	1	NA	NA	NA	0	0	0	0	1	0	0	1	0	0	1	0	NA	NA	NA	NA	NA	NA	NA	NA
0	0	0	1	0	NA	NA	NA	NA	NA	NA	NA	0	0	0	0	1	1	0	0	0	1	1	NA	NA	6	1	3.25	2.25	5	5
2	2	3	3	1	1	1	1	1	1
CX	1	1	0	0	1	0	0	1	1	0	0	0	1	0	1	0	0	1	0	1	0	0	0	0	1	1	0	0	0	0	0	0	1	0	0	0	0
1	0	0	0	0	0	0	0	0	1	0	0	0	0	1	0	0	15	3.5	6	1	5.5	5.5	5	5	2	2	1	2	1	1	1	1	2	2
DX	1	1	0	0	1	0	0	1	0	0	0	0	0	0	0	1	0	0	1	0	0	1	0	0	1	0	1	0	0	0	1	0	0	0	0	1	1
0	0	0	0	0	0	0	0	0	1	0	1	0	1	0	1	0	50	17.5	7.5	2.5	8.5	5	5	5	2	2	2	3	1	1	1	1
3	3
EX	1	0	1	0	1	0	0	1	NA	NA	NA	0	0	0	1	1	0	1	1	0	1	0	0	0	0	0	0	1	0	0	0	0	1	0	0
0	0	0	0	0	1	0	0	0	0	0	1	0	1	0	0	0	1	0	NA	NA	14.5	30	13	2.5	3	3	1	1	4	4	1	1	1
1	1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3	1	1
1	2	7	7
VY	0	0	1	0	0	1	0	1	0	1	0	0	0	0	1	1	0	0	1	1	0	1	0	0	1	0	1	0	0	1	0	0	1	1	1	0	0
0	0	0	1	0	0	0	0	0	0	1	1	0	0	0	1	0	135	17.5	5.5	17.5	2.75	2.25	5	5	2	2	2	3	1
1	1	2	5	7
WY	0	0	1	0	0	1	0	1	0	1	0	0	0	0	0	1	0	0	1	1	0	0	0	0	1	0	1	0	0	1	1	0	1	0	1	1	0
0	0	0	1	0	0	0	0	0	0	1	0	0	0	1	0	1	240	35	5.5	14	3.25	2.75	5	5	2	2	2	3	1	1	1
2	7	7
XY	0	0	1	0	0	1	0	1	0	1	0	0	0	0	1	1	0	0	1	1	0	0	0	0	0	1	0	0	0	1	0	0	1	0	0	0	0
0	0	1	1	0	0	0	0	0	0	1	0	0	0	1	0	0	175	27.5	4	10.5	2.5	1.875	5	5	2	2	2	2	1	1
1	1	6	7
YY	0	0	1	0	0	1	0	1	0	1	0	0	0	0	1	1	0	0	1	1	0	1	0	0	1	1	1	0	0	0	0	0	0	0	1	0	0
0	0	0	1	0	0	0	0	0	1	1	0	0	0	0	0	1	230	42.5	5.6	25	2.5	2.5	5	5	2	2	2	2	1	1	1
2	5	7
ZY	0	1	0	0	0	1	0	1	0	1	0	0	0	0	1	0	0	1	0	0	0	1	0	0	0	0	0	0	0	0	1	0	0	0	0	1	1
0	0	0	0	0	0	0	0	0	0	0	1	0	0	0	0	1	115	35	10.5	20	7.5	6.5	5	5	1	1	3	3	1	1	1	3
4	5

using this:

library(methods)
setClass("of")
setAs("character", "of", function(from) as.ordered(from))

Classe72<-cclasses <- c(rep("factor", 55),  rep("numeric",6), rep ("of",
12))

DFExample<-read.table("DFExample.txt", header=TRUE,row.names=1,
na.strings="NA" ,colClasses = Classe72) 

then "party with the mob":

library(party)

Test.mob<-mob(X1~1|X34+X45+X73, data=DFExample, model=glinearModel,
family=binomial())

Fehler in `[.data.frame`(x, r, vars, drop = drop) : 
  undefined columns selected

B.





Birgitle wrote:
> 
> I try tu use mob() with my data.frame ('data.frame':	288 obs. of  81
> variables; factors, numerics and ordered factors)
> My response is a binary variable and I should use for modelling a logistic
> regression (family=binomial).
> 
> I read in the "MOB" Vignette that I could use a formula like this if I
> would like to have only partitioning variables apart from the response.
> 
> Test.mob<-mob(Resp~1|Var1+Var2+...., data=dataframe, model=glinearModel,
> family=binomial())
> ...
> 
> 


-----
The art of living is more like wrestling than dancing.
(Marcus Aurelius)
-- 
View this message in context: http://www.nabble.com/mob%28party%29-formula-question-tp18959898p18961688.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list