Can lm return AIC information?
Thanks a lot!
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
Hi Michael,
use: extractAIC to get AIC from an lm object:
y - rnorm(10)
extractAIC(lm(y~1))
Christian
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
You can use AIC to get what you want.
#example from lm help page
ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group - gl(2,10,20, labels=c(Ctl,Trt))
weight - c(ctl, trt)
anova(lm.D9 - lm(weight ~
In my windows XP there is no read command as well,so the _
unix(read stuff)_ will not wor as what _system_ function does is to
pass the 'read stuff' command argument to the system command.
I guess the read command to specific to some Unix OS.
Hope this helps.
2006/6/9, [EMAIL PROTECTED]
On 6/9/06, Rafael A. Irizarry [EMAIL PROTECTED] wrote:
Hi!
I have used the Matrix package (Version: 0.995-10) successfully
to obtain the OLS solution for a problem where the design matrix X is
44000x6000. X is very sparse (about 8 non-zeros elements).
Now I want to do WLS: (X'WX)^-1X'Wy
Hi,
I am trying to write a function in R that receives one array (y) and one
list of arrays (mylist.of.array) with one or more arrays
I need get y in function of the arrays in mylist.of.array . I am a newbie in
R so I tryed the line bellow, that obviosly does not work
g-lm(y~ mylist.of.array)
François Pinard sent the following at 09/06/2006 00:53:
[Berton Gunter]
I would argue that histograms are outdated relics and that density
plots (whatever your favorite flavor is) should **always** be used
instead these days.
When a now retired researcher paid us a visit, I showed him
On Thu, 8 Jun 2006, Luo Weijun wrote:
I tried to build R-2.3.1 from source under Mac OS X
10.4.6. (I am doing so because only this way I can get
the 64-bit version of R)
The configure and make steps look fine. But I got
errors when I did make check-all, here is the message:
running code
g - lapply(x, function(z) lm(y ~ z))
On 6/9/06, Wagner Costa [EMAIL PROTECTED] wrote:
Hi,
I am trying to write a function in R that receives one array (y) and one
list of arrays (mylist.of.array) with one or more arrays
I need get y in function of the arrays in mylist.of.array . I am a
Hello All
I am having a bit of trouble formatting my HTML with the desired number
of digits after the decimal place. Am I doing something
wrong/misunderstanding or is it a bug?
Looking at the example supplied with ?HTML.data.frame:
HTML(iris[1:2,1:2],nsmall=c(3,1),file=)
Gives html
Hi all,
I would like to do a barplot of a dataframe like this one:
alfa beta gamma delta
qwert 56.5 58.5 56.5 58.5
asdfg 73.0 73.0 43.0 73.0
zxcvb 63.0 63.0 43.0 63.0
yuiop 63.0 63.0 43.0 63.0
with the labels of the rows and columns.
I would like to have something
John,
I don't think nsmall uses a vector. Try the following with format (which
HTML.data.frame uses):
format(iris[1:2,1:2],nsmall=c(3,1))
Sepal.Length Sepal.Width
15.100 3.500
24.900 3.000
It looks like you'll have to do a format column by column with a loop.
-
Hi All,
I have 2 arrays:
dim(a1)
[1] 3 23 23
dim(a2)
[1] 3 23 23
And I want a new array, to say, a3, where:
dim(a3)
[1] 6 23 23
where the first dimension is supposed to be (months) so the resultating
array would start in jan and finish in june.
Best regards,
Antonio
On Fri, 2006-06-09 at 06:05 -0500, Marc Schwartz wrote:
On Fri, 2006-06-09 at 11:26 +0100, Albert Vilella wrote:
Hi all,
I would like to do a barplot of a dataframe like this one:
alfa beta gamma delta
qwert 56.5 58.5 56.5 58.5
asdfg 73.0 73.0 43.0 73.0
zxcvb
On Fri, 2006-06-09 at 11:26 +0100, Albert Vilella wrote:
Hi all,
I would like to do a barplot of a dataframe like this one:
alfa beta gamma delta
qwert 56.5 58.5 56.5 58.5
asdfg 73.0 73.0 43.0 73.0
zxcvb 63.0 63.0 43.0 63.0
yuiop 63.0 63.0 43.0 63.0
with
Hi All,
I have 2 arrays:
dim(a1)
[1] 3 23 23
dim(a2)
[1] 3 23 23
And I want a new array, to say, a3, where:
dim(a3)
[1] 6 23 23
where the first dimension is supposed to be (months) so the resultating
array would start in jan and finish in june.
Best regards,
Antonio
--
=
Por favor,
Hi Tom
Thanks for the reply.
I see what you are saying - that format does not format using an nsmall
vector, though the documentation (of HTML.data.frame) and the example
suggest nsmall uses a vector.
Even if I went through and changed the columns with a loop the
HTML.data.frame would
Hi
something like
tab
alfa beta gamma delta
qwert 56.5 58.5 56.5 58.5
asdfg 73.0 73.0 43.0 73.0
zxcvb 63.0 63.0 43.0 63.0
yuiop 63.0 63.0 43.0 63.0
barplot(as.matrix(tab), beside=T, legend.text=T)
HTH
Petr
On 9 Jun 2006 at 11:26, Albert Vilella wrote:
From:
John, you can use format ahead of time (this converts to character
columns, so HTML won't reformat), and then use HTML:
z=format(iris[1:2,1:2],nsmall=3)
z[,2]=format(iris[1:2,2],nsmall=1)
HTML(z,file=)
- Tom
-Original Message-
From: john seers (IFR) [mailto:[EMAIL PROTECTED]
antonio rodriguez antonio.raju at gmail.com writes:
I have 2 arrays:
dim(a1)
[1] 3 23 23
dim(a2)
[1] 3 23 23
And I want a new array, to say, a3, where:
dim(a3)
[1] 6 23 23
You can (1) figure out how to transpose the
arrays (?aperm), put them together with c(),
and re-array()
hello!
my question conserns with use of panel package (written by R.C.Gentlman)
(unfortunately the manual and help sites are very short)
1. is it possible to do analysis just without a(ny) covariate? i
suggest do it by introducing a covariate with level=0 in all
obervations, this because of
On 6/8/2006 11:51 AM, Berton Gunter wrote:
I would argue that histograms are outdated relics and that density plots
(whatever your favorite flavor is) should **always** be used instead these
days.
But my favourite density plot is a histogram!
I agree that computational complexity should weigh
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect to this table:
library(DBI)
library(RODBC)
chan - odbcConnect(MySQL51, uid=root, pwd=xxx)
first
On Jun 9, 2006, at 7:38 AM, Duncan Murdoch wrote:
Now, if you were to suggest that the stem() function is a bizarre
simulation of a stone-age tool on a modern computer, I might agree.
But as a stone-age (blackboard) tool it is unsurpassed. It is the only
bright spot in the usually
Hi Tom
Excellent! Exactly what I need.
I see what you mean now.
Thanks very much for your help.
John
---
John Seers
Institute of Food Research
Norwich Research Park
Colney
Norwich
NR4 7UA
tel +44 (0)1603 251497
fax +44 (0)1603 507723
e-mail [EMAIL PROTECTED]
Dear all R users,
Suppose I have a data frame data like this:
5/2/2006 36560
5/3/2006 36538
5/4/2006 36452
5/5/2006 36510
5/8/2006 36485
5/9/2006 36502
5/10/2006 36584
5/11/200636571
Now I want to create a for loop like this:
date =
Hi,
I have been working through one of the examples on the FAQ about
rotating the labels on the x axis, I need to do the same but for the y
axis. I have managed to change some of the code, but I am still not
getting there, there is still something wrong. My syntax is as follows:
par(mar =
Dear R-Help,
As with the rpois() function to generate random data from a poisson
distribution, I need to generate random data from a quasi distribution with
var=mu^2.
Does anyone known how to do this?
Thanks in advance,
Hugues SANTIN-JANIN.
[EMAIL PROTECTED]
[[alternative HTML
On 6/9/2006 8:51 AM, Lapointe, Pierre wrote:
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect to this table:
library(DBI)
On Fri, 2006-06-09 at 14:13 +0100, d d [EMAIL PROTECTED] ac uk wrote:
Hi,
I have been working through one of the examples on the FAQ about
rotating the labels on the x axis, I need to do the same but for the y
axis. I have managed to change some of the code, but I am still not
getting
On 6/9/2006 8:51 AM, Lapointe, Pierre wrote:
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect to this table:
library(DBI)
test
V1V2
1 5/2/2006 36560
2 5/3/2006 36538
3 5/4/2006 36452
4 5/5/2006 36510
5 5/8/2006 36485
6 5/9/2006 36502
7 5/10/2006 36584
8 5/11/2006 36571
dates - strptime(test$V1, %d/%m/%Y)
---
Jacques VESLOT
CNRS
Try this:
Lines - 5/2/2006 36560
5/3/2006 36538
5/4/2006 36452
5/5/2006 36510
5/8/2006 36485
5/9/2006 36502
5/10/2006 36584
5/11/200636571
DF - read.table(textConnection(Lines), as.is = TRUE)
fmt - %m/%d/%Y
DF[,1] - as.Date(DF[,1], fmt)
date -
On 6/9/2006 9:42 AM, Lapointe, Pierre wrote:
On 6/9/2006 8:51 AM, Lapointe, Pierre wrote:
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can
Hi Folks,
I think I have searched exhaustively, including, of course R-help (D.
Bates, S. Graves, and others) and but I remain uncertain about
testing fixed effects with lmer(..., family=binomial).
I gather that mcmcsamp does not work with Do we rely exclusively on z
values of model
On 6/9/2006 9:42 AM, Lapointe, Pierre wrote:
On 6/9/2006 8:51 AM, Lapointe, Pierre wrote:
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect
Mark,
I don't know how many of these files you have, so this may not be a
viable solution, but what if you changed the function wait to be
something like the following:
wait - function() par(ask=T)
for(i in 1:100){
plot(rnorm(100) ~ rnorm(100))
wait()
}
So, in general, this is not a solution
AFAIK likelihood ratio tests are preferable, especially when you're
interested in testing several fixed-effects simultaneously. However,
since in GLMMs the likelihood cannot be calculated explicitly one
could wonder how does this affect LRTs.
Adaptive Gaussian quadrature is know to provide the
Hi Folks!
I need to execute a piece of R code inside a loop, say, every fourth
time my counter increases (it increases by 1 unit each time.)
Is there any sort of mod function in R to do this? Or is this done some
other way? Many thanks!
Best,
john
[[alternative HTML
Hi user R,
I am try to put degree character in axis x, but don't make this. I have
the next code:
plot(mot[,5],
time1,xlim=c(-45,-10),type=l,yaxt=n,ylab=,col=1,lwd=2,xlab=,xaxt=n)
The range of value in axis-x is -45 to -10, this values represents the
longitudes positions in space. I try
Hello,
I am using R 2.2.1 with sn 0.4.0 and am trying to save a dns2.plot as a jpg
file.
Here is the latest version of the code I have tried:
x - seq(0,200,length=200)
y - seq(0, 35, length=200)
jpeg(filename = C:/fig1.jpg, width = 5, height = 4,pointsize = 12, quality
= 100, bg = white, res =
Hello useRs,
Is there a way to reverse values of 2 variables (like with the language
Python) ? :
a - 1
b - 2
a, b - b, a
More specifically, I have a data frame :
famnum generation germain1 germain2 fa mo ptpn1 ptpn2 drb11 drb12
1 2 200 201 101 102 1 1
On Thu, 8 Jun 2006, [EMAIL PROTECTED] wrote:
Hi Everyone : As I mentioned earlier, I am taking a lot
of Splus code and turning into R and I've run into
another stumbling block that I have not been
able to figure out.
I did plotting in a loop when I was using Splus on unix
and the way I
With R 2.3.1 on Windows, I've noticed that it defaults to the
WinAsci.enc encoding, which throws up an error when viewed with the
default install of GhostScript/GSView (versions 8.51/4.7 respectively).
I didn't have this problem prior to upgrading to 2.3.1 as I can view all
my old PS graphs
There is a function here:
http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html
that will facilitate this sort of construct:
a - 1; b - 2
list[b,a] - list(a,b)
a; b # 2 1
On 6/9/06, David Hajage [EMAIL PROTECTED] wrote:
Hello useRs,
Is there a way to reverse values of 2 variables (like
Hi,
I'm trying to find this for 3 hours now so i come here to find any help.
How can I add a color bar to show the color scales to what is generated
by image(), similar to the one in figures generated by filled.contour()
using only the base package although i know there is solution with
Hi,
There should be a 20 page pdf document in the doc directory,
distributed with the package. That answers most of these questions.
Also, please read the posting guide so that you give enough
information to actually have some chance of answering your questions,
best wishes
Robert
Charles:
To be fair ... both histograms and densityplots are nonparametric density
estimators whose appearance and effectiveness are dependent on various
parameters. Neither are immune from misleading due to a poor choice of the
parameters. For histograms they are the bin boundaries; for kde's
You don't say what OS you are using, or whether you are getting any messages
or errors.
http://www.R-project.org/posting-guide.html
Larry Howe
On Friday June 9 2006 11:00, Martin Heller wrote:
Hello,
I am using R 2.2.1 with sn 0.4.0 and am trying to save a dns2.plot as a jpg
file.
Here is
I am analysing parasite egg count data and am having trouble with glm with a
negative binomial family.
In my first data set, 55% of the 3000 cases have a zero count, and the
non-zero counts range from 94 to 145,781.
Eventually, I want to run bic.glm, so I need to be able to use glm(family=
I just realized that the pdf on CRAN is corrupt, a new package has been
uploaded and will percolate through over the next few days, one supposes.
Robert Gentleman wrote:
Hi,
There should be a 20 page pdf document in the doc directory,
distributed with the package. That answers most of
It is WinAnsi, not WinAsci, and that may well be your problem. Vanilla R
2.3.1 uses WinAnsi (I have just re-checked), so there is `something
strange about my installation'.
On Fri, 9 Jun 2006, Jamie Lawrence wrote:
With R 2.3.1 on Windows, I've noticed that it defaults to the
WinAsci.enc
Did you consult the help page for neg.bin?
Details:
These are not intended to be called by the user. Some are for
compatibility with earlier versions of MASS (the book).
The book discusses the family negative.binomial() on p.206, and it is that
which glm.nb uses.
On Fri, 9 Jun
Hi list,
I'm looking for a way to calculate quantiles (such as in quantile()), but
with the ability to assign a different weight to each member of the sample
vector.
It is possible to write it out completely, but maybe there is a dedicated
function out somewhere...
cheers
Wouter
Doug,
I did mean wX = crossprod(X, W). sorry about that.
Thanks for the suggestions and for the *very* useful package. Im still
smiling about inverting a 6000x6000 matrix in one second with on line of
R code.
Best wishes,
-r
Douglas Bates wrote:
On 6/9/06, Rafael A. Irizarry [EMAIL
Take a look at ?plotmath.
-roger
fernando espindola wrote:
Hi user R,
I am try to put degree character in axis x, but don't make this. I have
the next code:
plot(mot[,5],
time1,xlim=c(-45,-10),type=l,yaxt=n,ylab=,col=1,lwd=2,xlab=,xaxt=n)
The range of value in axis-x is -45 to
I'm having a problem with output from date.mdy in the date package.
Goal: to take a long vector of dates of the form 01/22/99 and extract
values month=01, day=22, year=1999.
I am providing the vector of class dates in the attached file to date.mdy:
Wouter wrote:
Hi list,
I'm looking for a way to calculate quantiles (such as in quantile()), but
with the ability to assign a different weight to each member of the sample
vector.
It is possible to write it out completely, but maybe there is a dedicated
function out somewhere...
Wouter wrote:
Hi list,
I'm looking for a way to calculate quantiles (such as in quantile()), but
with the ability to assign a different weight to each member of the sample
vector.
It is possible to write it out completely, but maybe there is a dedicated
function out somewhere...
Hello,
I am trying to test a function argument to see if it is or is not a useful
number. However I cannot seem to find a test that works. For example
f = function(x) {
+ print(exists(x))
+ print(is.null(x))
+ }
rm(x)
f(z)
[1] TRUE
Error in print(is.null(x)) : Object z not found
exists
Larry Howe wrote:
Hello,
I am trying to test a function argument to see if it is or is not a useful
number. However I cannot seem to find a test that works. For example
f = function(x) {
+ print(exists(x))
+ print(is.null(x))
+ }
rm(x)
f(z)
[1] TRUE
Error in
On Fri, 2006-06-09 at 11:01 +, fernando espindola wrote:
Hi user R,
I am try to put degree character in axis x, but don't make this. I have
the next code:
plot(mot[,5],
time1,xlim=c(-45,-10),type=l,yaxt=n,ylab=,col=1,lwd=2,xlab=,xaxt=n)
The range of value in axis-x is -45 to
Many thanks to Dr Ripley, who told me to use negative.binomial instead of
neg.bin, and to Dr Lancelot, who pointed toward the excellent aod. My models
are now converging and the output I am getting seems reasonable.
Cheers,
Elizabeth
On 6/9/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:
Did you
x exists within the function f so the first print is TRUE;
however, exists does not try to evaluate it. is.null
does try to evaluate it and so at that point it discovers
the error.
Perhaps you want this:
f - function(x) if (exists(deparse(substitute(x print(is.null(x))
else print(none)
if
Hi,
I have a microarray data which has about 1 genes and 15 measurements. The
15 measurements contain 6 control, 3 low dose, 3 medium dose, 3 high dose. If I
treat the dose level as a continuous variable, how can I use ANCOVA to do gene
selection? (I mean to select those genes that
this is probably a bad question but if
you type a function name( the function is from a package ) at
an R prompt and you see that the main work of the function is done by a fortran
call (.Fortran ), is it possible to see the fortran code ? i am using windows
xp and R-2.20 but i doubt that
1. Google for: CRAN mypkg
where the package is called mypkg and then download and
2. unpack the .tar.gz from there: tar xfvz mypkg_0.1-1.tar.gz
(replace with correct filename)
On 6/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
this is probably a bad question but if
you type a function
G'day,
My problem is I'm not sure how to extract effect sizes from a nonlinear
regression model with a significant interaction term.
My data sets are multiple measurements of force response to an agonist
with two superimposed treatments each having two levels.
This is very similar to the
On Friday June 9 2006 16:06, Sundar Dorai-Raj wrote:
Larry Howe wrote:
This works because x exists in the function f. Perhaps you want this
instead?
f - function(x) {
print(deparse(substitute(x)))
print(exists(deparse(substitute(x
print(is.null(x))
invisible()
}
Your
Hello,
I am utilizing linear quantile regression models to analyze health survey
data. The survey (NHANES) is a multi-stage complex survey and I want to
incorporate survey sampling weights in generating my quantile estimates. To
my knowledge, this is currently not possible in SAS or STATA. Is
I have a function (masheff) which returns a value which I can optimize
no problem, eg:
optimize(masheff, c(15,30), maximum=TRUE, m_gd=5.13, v_tot=41, e_c=1.0)
I would like masheff() to return multiple values say as a list with
named elements like so:
v = masheff(...)
v$eff
v$extract
etc
Is
optimize will preserve attributes so try this:
f - function(x) structure(x^2, cubed = x^3)
optimize(f, c(-1, 1))
On 6/9/06, paul sorenson [EMAIL PROTECTED] wrote:
I have a function (masheff) which returns a value which I can optimize
no problem, eg:
optimize(masheff, c(15,30), maximum=TRUE,
version
_
platform x86_64-unknown-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major2
minor2.1
year 2005
Hi ..
I would like to have math symbols in perspective plots
i tried : persp(x,y,z,xlab=expression(phi))
but it plots it as phi.
Thanks.
Harsh
__
[[alternative HTML version deleted]]
I get the same thing on Version 2.3.1 Patched (2006-06-04 r38279)
but on R version 2.2.1, 2005-12-20 it gives character(0), as
expected, so there is some change between versions of R. I am
on Windows XP.
On 6/9/06, Patrick Connolly [EMAIL PROTECTED] wrote:
version
_
platform
75 matches
Mail list logo