Thanks a lot, Mark - the underscore fixed it immediately.
Message: 4 Date: Sat, 7 Aug 2010 03:33:20 -0500 From: Mark Larsen <larsen...@gmail.com> Subject: Re: [Rpy] Fitting a glm: AttributeError: 'Robj' object has no attribute 'control' To: "RPy help, support and design discussion list" <rpy-list@lists.sourceforge.net> Message-ID: <aanlktim-x08zckavnqnrpamiufnrnwjc1axsedbw7...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 > model = rpy.r.glm(formula, data = d, family = 'binomial', control = > rpy.r.glm.control(maxit = 500)) > > Traceback (most recent call last): > ?File "<stdin>", line 1, in <module> > AttributeError: 'Robj' object has no attribute 'control' It doesn't like the dot in the function name. Use: model = rpy.r.glm(formula, data = d, family = 'binomial', control = rpy.r['glm.control'](maxit = 500)) or model = rpy.r.glm(formula, data = d, family = 'binomial', control = rpy.r.glm_control(maxit = 500)) > Message: 3 > Date: Sat, 07 Aug 2010 09:59:56 +0200 > From: "Fanny Gaukeley" <solanace...@gmx.de> > Subject: [Rpy] Fitting a glm: AttributeError: 'Robj' object has no > attribute 'control' > To: rpy-list@lists.sourceforge.net > Message-ID: <20100807075956.89...@gmx.net> > Content-Type: text/plain; charset="utf-8" > > > Dear all, > I spent some time with trial and error and googling my Error and I didn't > find anything, so I was hoping you could help me. > > I'm fitting a linear model and want to change the default value of the > attribute 'control'. If omitting it, about 50% of my models stop with an > "algorithm didn't converge" error. > > Below is of course not the actual code but a really simplified version > that sums up what I need to do. > > > import rpy > > # some x values > a = [12, 89, 93, 14] > # binary vector as output > b = [1,0,0,1] > > rpy.set_default_mode(rpy.NO_CONVERSION) > formula = rpy.r("Y~X") > d = rpy.r.data_frame(X = a, Y = b) > > model = rpy.r.glm(formula, data = d, family = 'binomial', control = > rpy.r.glm.control(maxit = 500)) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > AttributeError: 'Robj' object has no attribute 'control' > > > I'm really hoping this is just a silly error on my part and someone can > help me out. > Thanks a lot! > Fanny > > > > > -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list