similar to: obtain names of variables and data from glm object

Displaying 20 results from an estimated 200 matches similar to: "obtain names of variables and data from glm object"

2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argument understands that "Variety" is a variable in the data. But the "scales" argument does not understand that "nitro" is a variable in the data.
2009 Oct 10
1
lattice auto.key drop unused levels
The following code produces a legend ("key") that mentions the unused levels of Block. library(MEMSS) xyplot(yield~nitro, subset=(Block=="I" | Block=="II"), data=Oats, group=Block, auto.key=T) and adding "drop.unused.levels=T" does not fix it. And in fact even the following does not solve the problem: xyplot(yield~nitro,
2009 Aug 03
3
session logging
Consider all the text that one sees on the console during an R session. Is there a way, within R, to make all this text--both the "output" and the "messages"--automatically get copied to a single text file, in addition to seeing it on the console? If I remember to save the console to a file at the end of my R session, that does it. But (1) That requires pointing and
2008 Jul 17
2
nested calls, variable scope
Below is an example of a problem I encounter repeatedly when I write functions. A call works at the command line, but it does not work inside a function, even when I have made sure that all required variables are available within the function. The only way I know to solve it is to make the required variable global, which of course is dangerous. What is the elegant or appropriate way to solve
2006 Jun 30
2
Passing arguments to glm()
Hi there I want to pass arguments (i.e. the response variable and the subset argument) in a self-made function to glm. Here is one way I can do this: f.myglm <- function(y,subfact,subval) { glm(d.mydata[,y]~d.mydata[,'x1'],family=binomial,subset=d.mydata[,subfact]==subval) } > str(d.mydata) `data.frame': 15806 obs. of 3 variables: $ y : Factor w/ 2 levels
2006 Apr 10
1
RE: Re: Prototype Ajax - How to pass my own params toonComplete
That technique will not work for this case. By default, the response element is passed in to the onComplete handler as the first argument. Basically, all ''bind'' does it let you bind the ''this'' element to the function, so when you reference this.whatever in the function, the ''this'' refers to ''this'' in the scope that the event
2009 Oct 28
3
variable labels to accompany data.frame
Often it is useful to keep a "codebook" to document the contents of a dataset. (By "dataset" I mean a rectangular structure such as a dataframe.) The codebook has as many rows as the dataset has columns (variables, fields). The columns (fields) of the codebook may include: ? variable name ? type (character, factor, integer, etc) ? variable label
2007 Oct 05
3
Mac GUI and .Renviron
The .Renviron and .First functions do not seem to work the same way on a Mac OS 10.4 as on a Windows XP machine. From working in Windows I am used to creating a new directory for each data analysis project. In the new directory I place First, an .Renviron file consisting of the following text: R_HISTFILE="history.txt" R_HISTSIZE=1000000 Second, an .RData file containing a .First
2006 Apr 10
10
Prototype Ajax - How to pass my own params to onComplete ?
Sorry if this has been covered before, i can''t imagine it hasn''t, but i''ve been unable to find any information on it. Can i pass my own parameters to the onComplete function specified by Ajax.Request ? My basic setup is i have an html element triggering an event (the ajax update). I have additional information encoded into the element about how it should handle
2010 Jun 05
1
glm output format
Hello,   I am running a loop to compare some residual deviances obtained from glm, with codes: ........   OUT<-NULL for (i in 1:10){  myglm<-glm(mat ~X1+X2+X3,family = binomial, data =myDATA) OUT<-c(OUT,myglm$deviance) }   .......   In the loop, X1, X2, and X3 chage with i. If X1, X2 and X3 are not highly correlated, OUT is a vector of 10 values.   The problem is:  if there there is
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types "lty" or colors "col" to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using 'type="n"', and subsequently execute a series of "points"
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot. A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2009 Aug 06
1
specify lattice black-and-white theme
Is there a simple way to specify a theme or trellis (lattice) parameters so that, in a multipanel (conditioned) plot, there is no color and in the strips there is no shading? This is the effect achieved on page 124 of Deepayan Sarkar's "Lattice" (figure 7.2). I managed to trick lattice into making a grayscale plot on my interactive display as follows: > graphics.off() >
2009 Aug 07
1
lattice: simultaneously control aspect & outer whitespace
Suppose we wish to achieve the following three aims: (1) Control the aspect ratio of our plot (i.e., tweak this till it looks great) (2) Save the plot as a PDF with zero or minimal white space outside it. (3) Preserve this in code, so that in the future the exact same plot can be reproduced by simply sourcing the code. I can almost achieve (1) and (2) on my MacBook Pro by pointing and clicking,
2005 Mar 18
2
logistic model cross validation resolved
This post is NOT a question, but an answer. For readers please disregard all earlier posts by myself about this question. I'm posting for two reasons. First to say thanks, especially to Dimitris, for suggesting the use of errorest in the ipred library. Second, so that the solution to this problem is in the archives in case it gets asked again. If one wants to run a k-fold cross-validation
2006 Mar 02
1
predict.glm - how to?
Hi I have a little R problem. I have created a GLM model in R and now I want to predict some values outside the values I have in the model (extrapolate). I have this code: fitted.model4 <- glm(Yval ~ time, family=gaussian, data=Fuel) The question is - How do I predict a value of Yval ie with a value of time = 340 and also get confidence/prediction intervals for Yvar? I have tried the
2009 Jan 14
1
loglm fitting
Dear all, sorry to bother you all with this but I've been trying to use the loglm in MASS package (v2.8.0) and cannot get any sensible output. I'm wondering am I doing something very foolish or missing something obvious. For example, I tried the documentation help(loglm) example - here's the code # Case 1: frequencies specified as an array. sapply(minn38,
2006 Apr 10
1
RE: Prototype Ajax - How to pass my own params toonComplete ?
You need a closure. onComplete: function (response) { NamedActionResponseHandler(theElement, response); } Is that what you mean? Greg > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs- > bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Erin Brewer > Sent: Monday, April 10, 2006
2009 Jul 02
1
skip the error to continue the logistic regression in a loop
Hi, everyone: I am running logistic regression on a bunch of variables using apply command. But an error occurs, the whole process stops. I am wondering if anyone knows how to skip this error and to continue the regression for the rest of variable. What I did is that first confine a function to the logistic regression, then use apply(data, 2, reg.fun) Then I got an error which is [1]
2003 May 30
2
color in plot title: title(sub="something", col=4)
Is there a way to specify the color of the main title, the subtitle, or the axis labels? I mean, for instance, something like title(main="cougar", col=2) For me, the above command produces the color black; that is, the "col" argument has no effect. I'm on a Windows 2000 machine with > version _ platform i386-pc-mingw32 arch i386 os mingw32 system