Re: [R] generalized linear mixed models - how to compare?

2005-04-19 Thread Andrew Criswell
Hello All:

Should I conclude from this discussion that there is no practical
means by which nested generalized mixed models can be compared from
output produced through glmmPQL or GLMM? What is one then to do???

Andrew


On Sun, 17 Apr 2005, Deepayan Sarkar wrote:

> On Sunday 17 April 2005 08:39, Nestor Fernandez wrote:


>> I want to evaluate several generalized linear mixed models, including
>> the null model, and select the best approximating one. I have tried
>> glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result
>> in similar parameter estimates but fairly different likelihood
>> estimates.
>> My questions:
>> 1- Is it correct to calculate AIC for comparing my models, given that
>> they use quasi-likelihood estimates? If not, how can I compare them?
>> 2- Why the large differences in likelihood estimates between the two
>> procedures?
>
>
> The likelihood reported by glmmPQL is wrong, as it's the likelihood of
> an incorrect model (namely, an lme model that approximates the correct
> glmm model).


Actually glmmPQL does not report a likelihood.  It returns an object
of class "lme", but you need to refer to the reference for how to
interpret that.  It *is* support software for a book.

> GLMM uses (mostly) the same procedure to get parameter estimates, but as a 
> final step calculates the likelihood for the correct model for those 
> estimates (so the likelihood reported by it should be fairly reliable).


Well, perhaps but I need more convincing.  The likelihood involves
many high-dimensional non-analytic integrations, so I do not see how
GLMM can do those integrals -- it might approximate them, but that
would not be `calculates the likelihood for the correct model'.  It
would be helpful to have a clarification of this claim.  (Our
experiments show that finding an accurate value of the log-likelihood
is difficult and many available pieces of software differ in their
values by large amounts.)

Further, since neither procedure does ML fitting, this is not a
maximized likelihood as required to calculate an AIC value.  And even
if it were, you need to be careful as often one GLMM is a boundary
value for another, in which case the theory behind AIC needs
adjustment.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



-- 
Andrew R. Criswell, Ph.D.
Graduate School, Bangkok University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] help with glmmPQL

2004-11-25 Thread Andrew Criswell
Hello:
Will someone PLEASE help me with this problem. This is the third time 
I've posted it.

When I appply anova() to two equations estimated using glmmPQL, I get a 
complaint,

anova(fm1, fm2)
Error in anova.lme(fm1, fm2) : Objects must inherit from classes "gls",
"gnls" "lm","lmList", "lme","nlme","nlsList", or "nls"

The two equations I estimated are these:
fm1 <- glmmPQL(choice ~ day + stereotypy,
+random = ~ 1 | bear, data = learning, family = binomial)
fm2 <- glmmPQL(choice ~ day + envir + stereotypy,
+random = ~ 1 | bear, data = learning, family = binomial)
Individually, I get results from anova():
anova(fm1)
  numDF denDF   F-value p-value
(Intercept) 1  2032   7.95709  0.0048
day 1  2032 213.98391  <.0001
stereotypy  1  2032   0.42810  0.5130
anova(fm2)
  numDF denDF   F-value p-value
(Intercept) 1  2031   5.70343  0.0170
day 1  2031 213.21673  <.0001
envir   1  2031  12.50388  0.0004
stereotypy  1  2031   0.27256  0.6017

I did look through the archives but didn't finding anything relevant to 
my problem.

Hope someone can help.
ANDREW

   _
platform i586-mandrake-linux-gnu
arch i586
os   linux-gnu
system   i586, linux-gnu
status
major2
minor0.0
year 2004
month10
day  04
language R

--
Andrew R. Criswell, Ph.D.
Graduate School, Bangkok University
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Error in anova(): objects must inherit from classes

2004-11-24 Thread Andrew Criswell
Hello:
Let me rephrase my question to attract interest in the problem I'm having. When 
I appply anova() to two equations
estimated using glmmPQL, I get a complaint,
anova(fm1, fm2)
Error in anova.lme(fm1, fm2) : Objects must inherit from classes "gls",
"gnls" "lm","lmList", "lme","nlme","nlsList", or "nls"

The two equations I estimated are these:
fm1 <- glmmPQL(choice ~ day + stereotypy,
+random = ~ 1 | bear, data = learning, family = binomial)
fm2 <- glmmPQL(choice ~ day + envir + stereotypy,
+random = ~ 1 | bear, data = learning, family = binomial)
Individually, I get results from anova():
anova(fm1)
   numDF denDF   F-value p-value
(Intercept) 1  2032   7.95709  0.0048
day 1  2032 213.98391  <.0001
stereotypy  1  2032   0.42810  0.5130
anova(fm2)
   numDF denDF   F-value p-value
(Intercept) 1  2031   5.70343  0.0170
day 1  2031 213.21673  <.0001
envir   1  2031  12.50388  0.0004
stereotypy  1  2031   0.27256  0.6017

I did look through the archives but didn't finding anything relevant to my 
problem.
Hope someone can help.
ANDREW

_
platform i586-mandrake-linux-gnu
arch i586
os   linux-gnu
system   i586, linux-gnu
status
major2
minor0.0
year 2004
month10
day  04
language R

--
Andrew R. Criswell, Ph.D.
Graduate School, Bangkok University
mailto:[EMAIL PROTECTED] 

mailto:[EMAIL PROTECTED] 

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-17 Thread Andrew Criswell
Hi All,
GRETL, a Gnu Regression, Econometrics and Time-series Library is 
open-source, cross-platform, multi-language and fully GUI based. The 
website is http://gretl.sourceforge.net/ This is NOT a personal plug, 
simply posted to show what can be done.

Andrew
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] gray background in png

2004-07-18 Thread Andrew Criswell
It also seems to work with two lines of code crossed out.
library(lattice)
z <- expand.grid(A = LETTERS[1:8], B = letters[1:6], x = 1, y = 1)
trellis.device(png, file = "test%02d.png") 
# par(bg = "white")
# lset(col.whitebg())
lset(list(background = list(col = "white")))
xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()

ANDREW
Deepayan Sarkar wrote:
On Sunday 18 July 2004 10:29, Liaw, Andy wrote:
 

Seems like a bug to me.  I tried setting theme=col.whitebg in
arguments to trellis.device, same result.  Setting
options(lattice.theme=col.whitebg) also does the same thing.  The
same thing happens win.metafile() for me. This is on WinXPPro,
R-1.9.1 and
   

Definitely a bug, but probably not where you would think. Note that 
col.whitebg() is misnamed, the background is actually  'transparent'. 
As far as I can make out, the first plot is the one that's wrong, all 
the subsequent ones are fine. (The apparent 'grayness' of the 
background is probably just a feature of your png displayer.) 

The workaround depends on whether you really want a white or transparent 
background.

For transparent:
library(lattice)
z <- expand.grid(A = LETTERS[1:8], B = letters[1:6], x = 1, y = 1)
trellis.device(png, file = "test%02d.png")
par(bg = "transparent")
lset(col.whitebg())
xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()
For white:
library(lattice)
z <- expand.grid(A = LETTERS[1:8], B = letters[1:6], x = 1, y = 1)
trellis.device(png, file = "test%02d.png") 
par(bg = "white")
lset(col.whitebg())
lset(list(background = list(col = "white")))

xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()
The reason for this, I think, is that grid seems to use par("bg") for 
the background of the first plot, but not for the rest. See, for 
example. the results of 

png(bg = "yellow")
grid.lines()
grid.newpage()
grid.lines()
dev.off()
I'll have to think about the best way to fix this. 

Deepayan
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] gray background in png

2004-07-18 Thread Andrew Criswell
Hello:
I was able to get two graphs with white background in JPG format, but 
only the first graph with PNG format (as previously remarked). 
Curiously, I only got the first graph saved (with white background) for 
the PDF format. Code follows...

ANDREW
library(lattice)
z <- expand.grid(A = LETTERS[1:8], B = letters[1:6])
z$x <- z$y <- rep(1, nrow(z))
png(file = "~/tmp/test%02d.png")
lset(theme = col.whitebg())
xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()
jpeg(file = "~/tmp/test%02d.jpg")
lset(theme = col.whitebg())
xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()
pdf(file = "~/tmp/test%02d.pdf")
lset(theme = col.whitebg())
xyplot(y ~ x | A * B, data = z, layout = c(4, 6))
dev.off()
> version
platform i686-pc-linux-gnu
arch i686
os   linux-gnu
system   i686, linux-gnu
status
major1
minor9.0
year 2004
month04
day  12
language R
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] help with paste

2004-07-12 Thread Andrew Criswell
Hello All:
Suppose the following little data frame:
> x <- data.frame(dog = c(3,4,6,2,8), cat = c(8,2,3,6,1))
>
> x$cat
[1] 8 2 3 6 1
>
How can I get the paste() function to do the same thing. The command 
below is obviously wrong

> paste(x, cat, sep = "$")
>
Thanks,
ANDREW
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: Windows versus Unix packages in CRAN (Was Re: [R] Rmetrics)

2004-05-20 Thread Andrew Criswell
Hello all:
On my linux platform, I ran the commands,
mkdir fBasics
unzip fBasics.zip -d fBasics
rm fBasics/src/*.o
R CMD check fBasics
That was 3 minutes. Next, I copied the files contained in 
fBasics.Rcheck/fBasics to the R library.

> library(fBasics)
fBasics:Markets, Basic Statistics, Date and TimeError in 
try(winMenuAdd("Rmetrics")) : couldn't find function "winMenuAdd"
>

So, how do I get it to work "with no problems" in Linux??
Thanks,
Andrew
Janusz Kawczak wrote:
And it seems that this vicious circle continues forever. Before
posting these kind of messages can you please read the INSTRUCTIONS.
fBasics_190.10051.zip is a COMPILED version of the package, not
a source as you claim to be!
It works with no problems; well, at least under Linux.
Janusz.
"Richard A. O'Keefe" wrote:
 

Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
   mkdir fBasics
   unzip fBasics.zip -d fBasics
   rm fBasics/src/*.o
   R CMD check fBasics
   and that took me about 3 minutes.
Now me, I just did
   unzip -a fBasics_190.10051.zip
   R CMD INSTALL fBasics
   rm -rf fBasics
in a naive and trusting manner.  It took me considerably longer than 3
minutes to learn that this was what I should do, and when I did learn,
I wondered "if it's this simple, why can't R CMD INSTALL do it?"
Now I discover that it isn't that simple.  The installation apparently
went smoothly.  This is R, right?  Never occurred to me that there might
be problems.
Now, B-G--R!  It turns out that core stuff is supplied as .dll files,
which of course my UltraSPARC can do nothing with.
The author of the Rmetrics code has a perfect right to provide his code
in any form he wants under any conditions he wants (subject to GPL &c).
In particular, if he wants to provide a distribution which only works under
Windows, that's perfectly OK.
**BUT** when a distribution is peculiar to one operating system, that really
should be highlighted in big bold letters:  this is a WINDOWS BINARY
version, so that people who can't use Windows .DLL files are spared a day
of trying to figure out how to unpack and of doing an installation which
reports no errors at all and of them finding that things do not work.
There is *NOTHING* on http://www.itp.phys.ethz.ch/econophysics/R/download.htm
that says "Windows only".  Click on "I accept"and the page you arrive at has
nothing in the text anywhere that says "Windows only" or "what to do if not
Windows".  (The http://.../R/bin/windows/contrib/1.9 address of the page
was, in retrospect, a big clue, sigh.)
   It would of course be nice if the developers had done
   R CMD check fBasics
But if you go into the Sources directory, which I suppose you must have,
for each of {fBasics,fExtremes,fOptions,fSeries} there is an
xxx-00check.log.txt, so they _did_ run R CMD check.
   and sorted out the errors, then
   R CMD build fBasics
Those same check logs show errors (like failure to build .dvi files).
Will it work if I download the Sources packages?
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
   

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: Windows versus Unix packages in CRAN (Was Re: [R] Rmetrics)

2004-05-19 Thread Andrew Criswell
Yes, I agree with Ajay Shah's comments. The Rmetrics website makes a 
virtue of open source yet the Rmetrics people do not make available 
their package for the open source platform, Linux.

Ajay Shah wrote:
Rmetrics - New Version is available for R 1.9 !!
   

 

in R-binary and R-source form from the site "http://www.rmetrics.org";,
and install the binary "zip" files in the usual way via the menu
   

I'm confused - does the fact that you are only distributing ".zip"
files means that (shudder) I need Microsoft Windows in order to run
this? (I hunted on the website but you seemed to only have .zip
files. That's very odd; normally on Unix we don't ship .zip files).
More generally: Do all R packages automatically run on Unix, or are we
fragmenting the CRAN code base into Unix and non-Unix packages? One of
my reasons for shifting to R was that it felt like a system that was
built by Unix people (roots in Bell Labs etc.). So it will have a
function like sink() as a nice counterpart to a function like source()
:-)
Ox, for example, has nice functionality but it felt like it was done
by Windows guys, so it wasn't going to be useful to me, and I kept
away.
If R packages are actually in two (intersecting) sets : those that run
on Unix and those that run on Windows, then do we need a CRAN/Unix and
CRAN/M$ directories to distinguish them? It will avoid a lot of wasted
time... e.g. I blew half an hour on investigating Rmetrics before
deciding they're a Windows crowd.
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] factor analysis

2004-05-14 Thread Andrew Criswell
Hello:
The website 
http://ourworld.compuserve.com/homepages/jsuebersax/tetra.htm might 
provide you with further hints and information on implementing 
polychoric correlations. Further information related to your inquiry can 
also be found on http://www.unt.edu/rss/class/rich/5840/

In addition, possibly relevant S+ code can be found on 
http://www.biostat.wustl.edu/archives/html/s-news/2001-02/msg00079.html

ANDREW
John Fox wrote:
Dear Allan,
I assume that the categorical data are ordinal. There are methods for
factor analyzing ordinal data (e.g., using polychoric correlations) and
mixed ordinal and interval data, but as far as I know, these aren't
implemented in R.
John
On Thu, 13 May 2004 18:32:11 +0200
allan clark <[EMAIL PROTECTED]> wrote:
 

hi all
this is a stats question.
when undertaking factor analysis should the variables included always
be
continiuos random variables? could one include categorical data? e.g
some survey type data
my gut feeling is that one should not include categorical type data
since factor analysis is based on the eigenanalysis of the
correlation
matrix of a group of variables. The introduction of categorical data
into a data set might "mess up" the corelation matrix.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
   



John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Arrow movements in R

2004-04-30 Thread Andrew Criswell
Hello:
I apologize for asking this question again.
I recently upgraded to R-1.9.1 but now the arrow keys do not scroll up 
and down the command lines in R. Instead I get  ^[[A

My SuSe 9 platform is missing some program. What is it?
Thanks,
ANDREW
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Constraining coefficients

2004-03-05 Thread Andrew Criswell
Thank you all for the advice.

So, to confirm: If I have

   data.0 <- data.frame(y, x1, x2)
   levels(data.0$x1) <- c('one', 'two', 'three')  ### three levels
   fm1 <- glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial, data = data.0)

then, what I need to do is merge the last two factors to one:

   data.0 <- data.1
   levels(data.1$x1) <- c('one', 'two', 'two')   ### two levels for factor
   fm2 <- glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial, data = data.1)
   anova(fm2, fm1, test = 'Chisq')
Although I understand it achieves the same result, I am not sure what 
numbers to plug into the contrast. The constrat, as it currently stands, is

contrasts(data.0$x1) <- matrix(c(0, 0,
1, 0,
    0, 1), ncol = 2, byrow = T)
Andrew



Prof Brian Ripley wrote:

On Fri, 5 Mar 2004, Andrew Criswell wrote:

 

I have a binomial model with one covariate, x1, treated as a factor with 
3 levels. The other covariate is measured x2 <- 1:30. The response, y, 
is the proportion of successes out of 20 trials.

glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial)

Now, I would like to constrain the cofficients on 2 levels of the 
factor, x1, to be identical and test the difference between these models 
by a likelihood ratio test.

How can I get glm() to constrain the coefficients on 2 levels to be the 
same?
   

Merge the levels of the factor: see ?levels.

You could also set up a custom contrasts matrix: either way the natural S
approach is to reparametrize rather than constrain.
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Constraining coefficients

2004-03-05 Thread Andrew Criswell
Hello All:

I have a binomial model with one covariate, x1, treated as a factor with 
3 levels. The other covariate is measured x2 <- 1:30. The response, y, 
is the proportion of successes out of 20 trials.

glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial)

Now, I would like to constrain the cofficients on 2 levels of the 
factor, x1, to be identical and test the difference between these models 
by a likelihood ratio test.

How can I get glm() to constrain the coefficients on 2 levels to be the 
same?

Thanks,
ANDREW
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Constraining coefficients

2004-03-05 Thread Andrew Criswell
Hello All:

I have a binomial model with one covariate, x1, treated as a factor with 
3 levels. The other covariate is measured x2 <- 1:30. The response, y, 
is the proportion of successes out of 20 trials.

glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial)

Now, I would like to constrain the cofficients on 2 levels of the 
factor, x1, to be identical and test the difference between these models 
by a likelihood ratio test.

How can I get glm() to constrain the coefficients on 2 levels to be the 
same?

Thanks,
ANDREW
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lyapunov exponent code for time series

2004-03-05 Thread Andrew Criswell
Dear Catherine:

You may wish to look at the website 
http://www.mpipks-dresden.mpg.de/~tisean/ which houses an open-source 
program and documentation that will do what you want.

ANDREW

--
Andrew R. Criswell, Ph.D.
Graduate School, Bangkok University
Xiaozhe (Catherine) Wang wrote:

Dear all, 
Has anyone worked on coding for calculating Lyapunov Exponent for a time
series data? or any package is available for computing Lyapunov?

Please advice and many thanks in advance.

Catherine X Wang

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Resampling Stats software

2003-12-16 Thread Andrew Criswell
A very good introductory text is "Data Analysis by Resampling: Concepts 
and Applications" by Clifford Lunneborg.

My search on Amazon fails to locate the book Brandon mentions, 
"Resampling: The New Statistics". Is there more information on Author, 
ISBN, etc.?

You may wish to look at appendix 8, "Bootstrapping Regression Models," 
to John Fox's "An R and S-Plus Companion to Applied Regression."  It can 
be found at 
http://socserv.socsci.mcmaster.ca/jfox/Books/Companion/scripts.html

ANDREW

Brandon Vaughn wrote:

Hi,

I am new to R (I have most of my experience in SAS and SPSS).  I was
wondering if anyone has used both Resampling Stats and R, and could comment
on strengths/relationships.  Also, I have no clue on how to do the various
examples from the book "Resampling: The New Statistics" in R.  Can anyone
give me some possible starting points?  Or websites/books?
Thanks,
Brandon
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] correlation and causality examples

2003-11-16 Thread Andrew Criswell
Hi all:

And then there's the classic case of higher frequency of cases with 
coronary heart disease in Arizona than NYC.  Does that support the 
hypothesis that cleaner air causes CHD or that those with CHD choose 
Arizona for its cleaner air?

ANDREW

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Problems with arrow keys

2003-10-14 Thread Andrew Criswell
Hello:

I just built R-1.8.0 on my Linux-Mandrake 9.0 using the commands,

./configure --enable-R-shlib
make
make install
It all seems to have gone fine.  But when I open R and use the arrow 
keys to try to go back to previous lines, it doesn't work.  What I get 
instead is something like.

> ^[[A^[[A^[[A^[[A^[[A

I didn't have this problem when I installed R-1.7.1 as rpm.  I could 
make use of the arrow keys.

Help!

ANDREW

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Exact logistic regression models

2003-10-09 Thread Andrew Criswell
Hello All:

Is there such a function in the R libraries: exact logistic regression?

Thanks,
ANDREW

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Logit reality check

2003-09-28 Thread Andrew Criswell
Hello all:

I've been given the following data and have been asked to run a logit 
model using glm().  The variable, Y, is a proportion ranging from 0 to 
1, X is a covariate.  Without a base number of observations from which Y 
is computed as a proportion, I believe there is not sufficient information.

If I try the model below, R seems to grumble with a complaint.

glm(cbind(Y,1-Y) ~ X, family = binomial)

non-integer counts in a binomial glm! in: eval(expr, envir, enclos)

Am I correct to believe that more information is required?

Thanks,
ANDREW
Y X
[1,]  0.40  41
[2,]  0.19  69
[3,]  0.20  60
[4,]  0.29  85
[5,]  0.14  48
[6,]  0.20  32
[7,]  0.11  69
[8,]  0.28  17
[9,]  0.35 115
[10,] 0.03  15
[11,] 0.14  11
[12,] 0.12  25
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Exact logistic regression

2003-03-06 Thread Andrew Criswell
Hello:

Is there a function that will do exact logistic regressions along the
line of LogXact?

Thanks,
ANDREW

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Odds ratio in fisher.test()

2003-02-25 Thread Andrew Criswell
Hello:

Please help me through my confusion. I am having trouble reconciling the
difference between what I believe is the conventional definition of an
odds ratio for a 2-by-2 table and the output produced by fisher.test()
in R. Consider the following example:

> Discrim <- matrix(c(1,10,24,17), 
+nr = 2,
+dimnames = list(AGE= c('young', 'old'),
+EMPLOY = c('fired', 'kept')))
> Discrim
   EMPLOY
AGE fired kept
  young 1   24
  old  10   17

The conventional odds ratio is computed as

> (1 * 17) / (24 * 10)
[1] 0.0708

Why is it, when I use fisher.test(), I get an estimated odds ratio like
that reported below? There, the difference seems slight, but with other
cases it can be quite large.

> fisher.test(Discrim, alternative = 'two.sided')

Fisher's Exact Test for Count Data

data:  Discrim 
p-value = 0.005242
alternative hypothesis: true odds ratio is not equal to 1 
95 percent confidence interval:
 0.001573963 0.606416320 
sample estimates:
odds ratio 
0.07407528


Thanks,
ANDREW

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Getting graphs into LaTeX

2002-12-20 Thread Andrew Criswell
Thanks to all who responded to my inquiry.  Bingo, it works!

I revised the code as follows and it works fine:

For the R code:
___
pdf()

pdf('lecture00-graph-01.pdf',
  horizontal = FALSE, height = 6, pointsize = 10)

hist(trial.outcome.5, breaks = 5,
main = '1000 Replications of 5 Trials of a Coin Toss',
xlab = 'Frequency of a Tail')

dev.off()
___

For the LaTeX document:
___

\documentclass[11pt]{article}
\usepackage[pdftex]{graphicx,color}
\begin{document}
\includegraphics{lecture00-graph-01}
\end{document}

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] Getting graphs into LaTeX

2002-12-19 Thread Andrew Criswell
Hello ALL:

I ran with success the following commands in R getting a file saved

postscript()

postscript('~/data/st202/2003/lecture00/lecture00-graph-01.eps',
  horizontal = FALSE, height = 6, pointsize = 10)

hist(trial.outcome.5, breaks = 5,
main = '1000 Replications of 5 Trials of a Coin Toss',
xlab = 'Frequency of a Tail')

But when I try to include it within a LaTeX document, I get the 
following complaint.

LaTeX document (trix.tex):

\documentclass[11pt]{article}
\usepackage[pdftex]{graphicx,color}
\begin{document}
\includegraphics{lecture00-graph-01.eps}
\end{document}

Which I try to compile with the command:  pdflatex trix.tex

But then, I get this error:

! LaTeX Error: Unknown graphics extension: .eps.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
...

l.5 \includegraphics{lecture00-graph-01.eps}

?

Any suggestions?

Thanks,
ANDREW

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help