This is covered in the R-admin manual:
Note that the BLAS library will be used for several add-on packages as
well as for @R{} itself. This means that it is better to use a
shared/dynamic BLAS library, as most of a static library will be
compiled into the @R{} executable and each
In fact you have an ftable, not a multi-way table, but as.data.frame works
for multi-way tables, and here as.data.frame(as.table(ftabc)) works:
as.data.frame(as.table(ftabc))
A B CC Freq
1 1 1 1 20
2 2 1 1 38
3 3 1 1 20
4 1 2 1 22
5 2 2 1 25
6 3 2 1 23
...
It would
Sorry, some things got garbled in that request for help that might make
my request
unintelligible, probably it being too late at night when I posted, here
is the corrected function
call for which I would like to learn how to add horizontal grid lines.
Any suggestions
would be appreciated.
Hi all --
I have to calculate a likelihood ratio test for a logit model. I
found logLik, but I need to calculate the log likelihood for the model
without any predictors. How can I specify this in glm? If the full
model is glm(y ~ x1), is the one without predictors (y ~ 0)? Or (y ~
1)?
?glm and have a look at the components of the list returned by the
object (i.e. glm.mymodel) of class glm
(glm.mymodeld$null.deviance - glm.mymodeld$deviance)
best, isaia
Original Message
Subject: [R] Running a likelihood ratio test for a logit model
Date: Thu, 18 May 2006
the print method for glm object already shows you the null and
residual deviance with the associated df; look also at the Value
section of ?glm.
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Hi - I'm trying to avoid using a 'for' loop due to inefficiency and instead use
a function (and ultimately tapply as I'm working on a matrix) but I can't
figure out how to get 'function' to take the variables as anything other than
vectors for example
aa-0
x-1:4
test.fun-function(x)
?cumsum
system.time({ z - NULL ; for (i in 1:1000) z - c(z, sum((1:i)**2)) })
[1] 0.04 0.00 0.04 NA NA
system.time( zz - cumsum((1:1000)**2) )
[1] 0 0 0 NA NA
all.equal(z,zz)
[1] TRUE
---
Jacques VESLOT
CNRS UMR 8090
Thanks for your reply, though this still wouldn't work with a function for
example, starting code like below fails because x is read as a vector as
opposed to doing it for x=1 then x=2 - is there any way of tweaking the code
easily, or do I just resign myself to for loops to do that?
Actually I had just meant that because I had some factors I had a
conceptual table. Using ftable() was just my way of getting the factors
into data frame form. But thank you for showing me that as.data.frame()
does exactly what I want.
Murray Jorgensen
Prof Brian Ripley wrote:
In fact you
Dear All,
often I encounter variables, which have only few distinct values and an
inherent metric. An example would be a risk score, which classifies
patients in several groups like low, intermediate, high, extreme with
corresponding risk estimates of 0, 1, 2, 5.5.
In some cases, like tables and
sorry, don't understand your problem...
i think it's better to use matrices directly or faster funtions;
but sapply(1:4, function(x) ...) can do the job easily instead of 'for' loops.
---
Jacques VESLOT
CNRS UMR 8090
I.B.L (2ème
On Thu, 18 May 2006, Dimitris Rizopoulos wrote:
the print method for glm object already shows you the null and
residual deviance with the associated df; look also at the Value
section of ?glm.
Note though that deviances are not (log) likelihood ratios, but
differences in deviances are twice
Hi R Gurus!
I conducted regression and anova followings :
Coefficients:
Estimate Std. Error t value Pr(|t|)
(Intercept) 6.07e-01 5.95e-02 10.19 2e-16 ***
nemp 2.87e-06 1.04e-07 27.63 2e-16 ***
'An Introduction to R', section 2.6 couldn't really be any clearer.
You'll find the document on your computer.
Peter Ehlers
YIHSU CHEN wrote:
Dear R users:
I have an elementary question: how to creat a vector of [A1, A2, A3..
A300]? I know c(1:300) would give 1, 2, 3, , 300 but
Kum-Hoe,
You need to used the summary function. I hope the example below will
help you get the coefficeints:
myfit-lm(y1~x1)
coefficients(summary(myfit))
John
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of
Hi,
I'm astudent in hydrobiology and I actually work on river's discharge and try
to extract from my data the seasonal and trend components. I use STL function
but I have several problems in understanding what this function have done.
I'd like to know what means the IQR results which gave me
Dear R-help list
I have problems setting parameters for the autocorrelation function plot. I
would like to Sweave a document with an ACF plot. Firstly the plot does not
show in my document (the eps file seems to be corrupted), and secondly I
would like to have it strictly black and white (like in
Dear all,
I found a wonderful package (vcd) able to plot ternary diagrams, i.e.
ternaryplot (thanks D. Meyer).
The problem is that one of three variable has negative values.
If I use the ternaryplot function but some points are outside the
triangle, as value en negative.
Is it possible to
Dear Terry,
I'm not entirely sure if this is what you're looking for, but here's my
suggestion.
To make more uniformly distributed points, you might try something like
xy - expand.grid(list(seq(0,1,.1), seq(0,1,.1)))
plot(jitter(xy[,1], 1.5), jitter(xy[,2], 1.5))
Like I said, I don't know if
Roger Schürch wrote:
Dear R-help list
I have problems setting parameters for the autocorrelation function plot. I
would like to Sweave a document with an ACF plot. Firstly the plot does not
show in my document (the eps file seems to be corrupted), and secondly I
would like to have it
Hi,
If you are looking for data clustered in two dimenstions you can use the
multivariate normal package.
Ritwik Sinha
http://darwin.cwru.edu/~rsinha
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
Actually, based on a post by Deepayan Sarkar
(http://finzi.psych.upenn.edu/R/Rhelp02a/archive/49615.html), this seems
to be the way to get an all black and white plot:
echo=FALSE,results=hide=
library(lattice)
ltheme - canonical.theme(color = FALSE) ## in-built BW theme
Beutel, Terry S Terry.Beutel at dpi.qld.gov.au writes:
I am trying to generate two dimensional random coordinates.
For randomly distributed data I have simply used
xy-cbind(runif(100),runif(100))
However I also want to generate coordinates that are more uniformly
distributed, and
Perhaps you're looking for something along the lines of Sobol
sequences - refer Section 7.7 of Numerical Recipes in C by Press et
al.
Sean
On 18/05/06, Ben Bolker [EMAIL PROTECTED] wrote:
Beutel, Terry S Terry.Beutel at dpi.qld.gov.au writes:
I am trying to generate two dimensional random
Hi all.
I have a pure R programming question.
Having a data.frame with a 'data' variable and some (1) ID variables
(either numeric or factors), I would extract a sequence of data values given
a sequence of ID values.
Here's an example. Build a dataset:
n1 - 5
n2 - 2
v1 - rep(factor(1:n1),2)
v2 -
Hi,
How can I write the output to an excel (csv) file without printing row names
(i.e without breaks). Here is my code:
library(
fn - function()
{
q - c(1,2,3)
write.csv(q,C:/Temp/op.xls, append = TRUE, row.names = FALSE,quote = FALSE)
}
# Function Call
for(i in 1:3)
Howdy
I apologize for duplicated posting. But I decided to correct my previous
posting.
I had the regression results using
r - lm(Y ~ nemp + as.factor(devt), data=d).
First, there is the result of anova(r). Here I could not find regression
coefficients.
Response: Y
Df
On 5/18/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Thu, 18 May 2006, Dimitris Rizopoulos wrote:
the print method for glm object already shows you the null and
residual deviance with the associated df; look also at the Value
section of ?glm.
Note though that deviances are not (log)
Your self-contained example interested me, because both lme{nlme} and
lmer{lme4} returned only error messages for my saturated models, but
'aov' solved it fine. I'd be interested in hearing from someone else if
it's actually possible to solve your problem using either 'lme' or
Dear list members,
I'd like to perform a glm analysis with a hierarchically nested design. In
particular,
I have one fixed factor (Land Use Classes) with three levels and a random
factor (quadrat) nested within Land Use Classes with different levels per
classes (class artificial = 1 quadrat;
On May 18, 2006, at 10:37 AM, Kum-Hoe Hwang wrote:
Howdy
I apologize for duplicated posting. But I decided to correct my
previous
posting.
I had the regression results using
r - lm(Y ~ nemp + as.factor(devt), data=d).
Can you tell us how many levels of devt there are?
Do
Dear All
When drawing a classification tree with
plot(mytree)
text(mytree)
the conditions are written just before the nodes branch. My question
is: can one be certain that those conditions refer to the left-side
branches? (The R documentation surprisingly lacks the information that
I am asking
On Thu, 18 May 2006, Chris Bergstresser wrote:
On 5/18/06, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Thu, 18 May 2006, Dimitris Rizopoulos wrote:
the print method for glm object already shows you the null and
residual deviance with the associated df; look also at the Value
section of
maybe merge() is what you're looking for, e.g.,
dat - data.frame(x = rnorm(10), v1 = gl(5, 2), v2 = rep(1:2, 5))
ids - data.frame(v1 = c(2, 3, 4), v2 = c(1, 2, 1))
#
dat
merge(dat, ids)
I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Ph.D. Student
On 5/18/06, Carlos Ortega [EMAIL PROTECTED] wrote:
Are you referring to ?:
- library(tree)
- library(rpart)
On 5/18/06, Paul Smith [EMAIL PROTECTED] wrote:
Dear All
When drawing a classification tree with
plot(mytree)
text(mytree)
the conditions are written just before the nodes
I'm still relatively new to R, so my apologies if this is covered
somewhere. I've been running some mixed-effect models in R using
lme{nlme}, but read in Faraway's recent book, Extending the Linear Model
with R, that lmer in package lme4 is a much improved version. I tried
using this approach,
Dear R users:
My question is how to write output in a specific formate with irregular
spacing?
Say that I have the following DF with three columns (A-C):
A B C
a10 100.0 212
The objective is to write an output file such that column A occupies
1-10 spaces aligned to the
On 5/18/06, Carlos Ortega [EMAIL PROTECTED] wrote:
Yes, that is right.
The conditions on top of the branches refer to the left-hand side.
Thanks, Carlos. Then, it should be explicitly said in ? text.rpart.
Paul
__
R-help@stat.math.ethz.ch mailing
You may find it helpful to read the posting guide (http://www.R-
project.org/posting-guide.html)
On May 18, 2006, at 11:40 AM, Lusk, Jeffrey J wrote:
I'm still relatively new to R, so my apologies if this is covered
somewhere. I've been running some mixed-effect models in R using
lme{nlme},
When submitting your example under R.2.3.0 WinXP, the resulting xls file
was output row-wise as requested. See results below. Not sure why yours
outputs columnar-wise.
To drop the variable name set col.names=FALSE. Note that the write.csv
wrapper is designed to be inflexible and that you
Have you tried 'RSiteSearch'? RSiteSearch(bestARIMA) produced
nothing for me, but RSiteSearch(best ARIMA) produced several hits, one
of which led me to try RSiteSearch(automatic ARIMA). This in turn led
me to a post that suggested Hyndman's Forecast package and the dse
bundle. The
?subset is handy.
You could build a 2nd data.frame containing the extraction value
combinations and use merge to get the inner join results. If a combination
is not known to exist the result will be extracted , otherwise no harm is
done.
- Original Message -
From: Antonio, Fabio Di
Hi User R
I am try to create a date vector with weeks of the year as show in the
data below, for a time series of sea surface temperature near to the
coast (i.e the points from image that are inside the polygon object; the
first 20 miles from the coast. Any body can tell me how create this
Dear R-users,
I have matrix (mprecip) with headers:
dim(mprecip)
[1] 6268 170
mprecip
date GilzeRijen Eindhoven Volkel ZuidLimburg Arcen Ubachsberg
101/01/1978 NA 0.0 NA 0.1NA NA
201/02/1978 NA 0.0 NA 0.0
Dear R-users
Sorry for posting the previous message too soon before I have finished it.
I have matrix (mprecip) with headers:
dim(mprecip)
[1] 6268 170
mprecip
date GilzeRijen Eindhoven Volkel ZuidLimburg Arcen Ubachsberg
101/01/1978 NA 0.0 NA
probably ?reshape() could be used in this case; I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web:
On Thu, 18 May 2006, Rado Bonk wrote:
Dear R-users
Sorry for posting the previous message too soon before I have finished it.
Hi Rado,
I think reshape() of mprecip as a data frame will do it, or stack(), my
closest attempts so far were:
reshape(mprecip, direction=long, idvar=date,
try:
reshape(mprecip, direction='long', idvar='date',
varying=list(names(mprecip)[-1]), v.name=percip, times=names(mprecip)[-1])
On 5/18/06, Roger Bivand [EMAIL PROTECTED] wrote:
On Thu, 18 May 2006, Rado Bonk wrote:
Dear R-users
Sorry for posting the previous message too soon
Deepayan,
Thanks for the helpful responses to my questions. I've provided users
with another example of
how to use and customize you wireframe plot. I needed to generate
graphics for scientific
presentations and posters. The line colors, line width, font size, font
orientation, etc... were
?sprintf
On 5/18/06, Yihsu Chen [EMAIL PROTECTED] wrote:
Dear R users:
My question is how to write output in a specific formate with irregular
spacing?
Say that I have the following DF with three columns (A-C):
A B C
a10 100.0 212
The objective is to write an
On 5/18/06, ken knoblauch [EMAIL PROTECTED] wrote:
Sorry, some things got garbled in that request for help that might make
my request
unintelligible, probably it being too late at night when I posted, here
is the corrected function
call for which I would like to learn how to add horizontal
There are also the functions: triangle.plot in package ade4, triplot in
package TeachingDemos, tri in package cwhtool, and soil.texture in
package plotrix. Perhaps one of these other functions will work better
for you (all do the triangular plots, each with different bells and
whistles).
triplot
Ternary plots are typically used to plot triplets of values (e.g.
composition of 3 components) that add up to 100% or 1. In this context, I am
not sure what a negative value means. Do the 3 numbers in your application
still add up to 100%? Alternatively, would it be meaningful to translate
the
I am a relative R newbie and I am having trouble with reshape() on R
V1.9.1 on Linux. The same code appears to be ok when run on R V2.2.0 on
Windows and a V2.1 on Linux. Any help would be great as I need to stay
on V1.9 for the immediate future... Thanks, Reid Hutchins
df -
On Thu, 18 May 2006, Hutchins, Reid wrote:
I am a relative R newbie and I am having trouble with reshape() on R
V1.9.1 on Linux. The same code appears to be ok when run on R V2.2.0 on
Windows and a V2.1 on Linux. Any help would be great as I need to stay
on V1.9 for the immediate future...
Hi all,
This may seem like a dumb question, but I work for an entity that is soon
converting to XP across the board, and I will lose the ability to install
software on my own. The entity has a policy of only using software that has
been purchased and properly licensed (whatever that means).
On 5/18/06, Rado Bonk [EMAIL PROTECTED] wrote:
Dear R-users
Sorry for posting the previous message too soon before I have finished it.
I have matrix (mprecip) with headers:
dim(mprecip)
[1] 6268 170
mprecip
date GilzeRijen Eindhoven Volkel ZuidLimburg Arcen Ubachsberg
Damien,
I think there isn't such a vendor. Maybe you can try to buy S-Plus.
Maybe you can look for donations to R foundation or reading the
licence term.
HTH,
Rogerio.
- Original Message -
From: Damien Joly [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Thursday, May 18, 2006
If you are just trying to create a character vector of the form week-year
then
paste(fecha[,2], fecha[,1], sep = -)
or
sprintf(%02.0f-%4.0f, fecha[,2], fecha[,1])
will do it (the second will zero fill as well).
or if you are trying to create a vector of class Date and then print
that then
[Damien Joly]
The entity has a policy of only using software that has been
purchased and properly licensed (whatever that means). [...]
Any ideas?
[Rogerio Porto]
I think there isn't such a vendor.
A while ago, the Cygnus organisation has been created to address this
kind of need,
what is your criterion of 'best arima'? there are more than 1
criterion for 'best' model.
On 5/15/06, Michael [EMAIL PROTECTED] wrote:
I tried to find a function called bestARIMA but it did not show up... even
on google it does not show up often:
I've only found the following link with
Rolf,
The formula can be found in section 1.44-1.45
'Trigonometric (Fourier) series' of the famous book:
Gradshteyn I.S and Ryzhik I.M. Tables of Integrals,
Series, and Products. Academic Press Inc. 4th printing.
London 1983.
Which is a translation of the Russian book from 1963.
Hope it helps,
Can anyone offer any help with coding the following in R?
I want to find (and store) Weighted Least Squares estimates of the
regression parameters for the following model:
z_i = beta_0 + beta_1.x_i + e_i; i=1,2,...,m
where e ~ N[0, 1/(ni.pi.(1-pi))], sum(ni)=n
and pi =
Hi All,
I use the stepAIC to select the variables of Cox ph model. But I got one
error as the following:
Start: AIC= 239.32
Surv(SURVP, STATP) ~ AGEBMT_med + SEX + DXCODE + STAGEGRP + BSYMDX +
BMINVDX + PS + IPIGROUP + INITXGRP + INICHEMO + PRICHEMO +
PRIRESP + DXBMTMON +
I sent the query below out to '[EMAIL PROTECTED]'
which was probably not appropriate.
I seem to have run into some weird behavior concerning the latest
Windows version 2.3.0 of R.
It does not happen in 2.2.1.
I have reduced it to a very simple exersise and I attach the workspace
after things are
Hello ,
Hey! I have been trying to get in touch with you. I finally got a cam so you
can see me when we talk. http://ca.geocities.com/kellyas0021/cam.html
--
This e-mail was sent through the XA-speakers file database. The webmasters of
the XA-speakers file database take no
I wrote some code to merge some columns from different data frames
into a new data frame based on mapping data in one of the columns. I
know that I can use the merge function for this, and now, in
retrospect, I don't know why I didn't. However, it seems like the
code that I wrote should
Dear R users;
A follow-up question regarding writing to a file with fixed precision:
Assuming for each column of x, I would like to have a different format, then I
modify the code as:
x.fmt - apply(x, 1, function(x) sprintf(%.14f %.10f %2.5f, x))
where three different formats are %.14f %.10f
Hello, does R estimate belief networks to estimate chains of causality.
Anyone point me to the right direction, or the most developed library?
looking at DEAL
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
On 5/18/2006 8:06 PM, Scholz, Fritz wrote:
I sent the query below out to '[EMAIL PROTECTED]'
which was probably not appropriate.
I seem to have run into some weird behavior concerning the latest
Windows version 2.3.0 of R.
It does not happen in 2.2.1.
I have reduced it to a very simple
Hi, I am beginning to learn R and have a data table that I would like to
produce a microarray-like plot. The table looks like this:
3 0 0 3 -377.61 1.94
3 0 0 3 -444.80 2.36
2 1 0 3 -519.60 2.39
1 1 1 3 -54.88 2.49
2 1 1 4 -536.55 2.53
1 0 1 2 108.29 2.62
2 0 0 2 39.56 2.62
3 0 1 4 108.32 2.63
2
On 5/18/2006 8:20 PM, YIHSU CHEN wrote:
Dear R users;
A follow-up question regarding writing to a file with fixed precision:
Assuming for each column of x, I would like to have a different format, then
I modify the code as:
x.fmt - apply(x, 1, function(x) sprintf(%.14f %.10f %2.5f, x))
Background:
OS: Linux Ubuntu Dapper
release: R 2.3.0
editor: GNU Emacs 21.4.1
front-end: ESS 5.2.3
-
Colleagues
I have two spatial datasets (latitude, longitude, fish eggs) and
(latitude, longitude, fish larvae) at the same 280 stations (i.e. 280
In case you don't already have all this, permit me to identify it as
a confluent hypergeometric function. Abramowitz and Stegun (1964)
Handbook of Mathematical Functions (National Bureau of Standard, Applied
Math Series 55, expression 13.2.5):
Gamma(a)U(a, b, z) =
integral{over t=0
Hello...
I would like to use R for 'pipelining' data among several programs. I'm
wondering how I can use R to call another program, feed that program a set
of parameters, and retrieve the output.
E.g., I have an executable that, when opened, prompts the user to enter a
set of parameters.
I assume that I have missed something fundamental and that it is there in front
of me in An Introduction to R, but I need someone to point me in the right
direction.
x1 - 1159 1129 1124 -5 -0.44 -1.52
x2 - c(1159,1129,1124,-5,-0.44,-1.52)
x3 - unlist(strsplit(x1, ))
str(x2)
chr [1:6]
## Thank you for a very nice example. I would like to make two
## expansions on the discussion that Spencer Graves gave.
## Rich
## 1. Multiple regression is a sequential algorithm. In the
## sequential anova table the sums of squares for non-orthogonal
## predictor variables depends on the
Dear R Users
Does anyone know how to read a text with a specific format? I know that has
to do with two functions: read.table and sprintf but not sure how to put them
together. Say that I have a text file called data.txt, and I would to read
it according with %.14f %.10f %2.5f, which
read.table segments rows by separators, not by format of entry.
Suppose your data.txt is like:
1.00 2.01 3.003
4.10 5.22 6.333
7.22 8.88 9.99
Then
read.table(data.txt, sep = )
Best Regards
XiaoQuoting YIHSU CHEN [EMAIL PROTECTED]:
Dear R Users
Does anyone know how to read a text with a
your code works for me, e.g.,
x1 - 1159 1129 1124 -5 -0.44 -1.52
x2 - c(1159, 1129, 1124, -5, -0.44, -1.52)
x3 - unlist(strsplit(x1, ))
all.equal(x2, x3)
[1] TRUE
as.numeric(x2)
[1] 1159.00 1129.00 1124.00 -5.00 -0.44 -1.52
as.numeric(x3)
[1] 1159.00 1129.00 1124.00
This is not really weighted least squares, since the weights depend on the
parameters beta_*: WLS refers to pre-specified weights and can be done by
lm().
It looks very like an approximation to logistic regression, which can be
fitted by glm. But fits for this model can be done by nls (see
82 matches
Mail list logo