I am interested in making a random sample from a uniform distribution
of points over the surface of the earth, using the WGS84 ellipsoid as
a model for the earth. I know how to do this for a sphere, but would
like to do better. I can supply random numbers, want latitude
longitude pairs out.
Dear useRs,
I am trying to fit a Cox PH model on survival data from a lung cancer
dataset. I would like to include the patient staging (I-IV) as a
covariate. For this I use the following function:
coxph(Surv(time,status) ~ stage)
The staging information is a categorical variable, and it is
Hi,
You can read a CSV file using the following way
MyData-read.csv(file.choose())
Regards,
Pratap
[EMAIL PROTECTED] wrote:
On 17-Feb-07 H. Paul Benton wrote:
Hello all,
I'm looking for a way to be able to read a text file into R.
It's a csv file but when I do
txt
Dear all,
I would like to use the Levenberg-Marquardt algorithm for non-linear
least-squares regression using function nls.lm. Can anybody help me to
find a a way to compute confidence intervals on the fitted
parameters as it is possible for nls (using confint.nls, which does not
work for
Well, the algorithm used does not affect the confidence interval (provided
it works correctly), but what is nls.ml (presumably in some package you
have not mentioned) and why would I want to use an old-fashioned
algorithm?
You could start nls at the solution you got from nls.ml and use
Dear R listers,
I have developed a C function to be executed from R through the .C interface.
After doing dyn.load, the function executes properly and I get the results.
However, after executing my function, R seems to get unstable and crashes
(giving a segmentation fault and exiting) whenever
On 2/20/07, d. sarthi maheshwari [EMAIL PROTECTED] wrote:
Hi,
Kindly let me know if I posted a wrong question in the forum.
I want to draw a splom plot with different symbols in plot. My command is as
follows:
splom(~ log10(splomData[2:3]), groups = programs, data = splomData,
panel =
But I recently realized something. Most of the variables that I've
tested as fixed effects are properties of the subject (e.g. Race,
Gender, etc.). Is it correct to be using a random effect
Subject that is nested within (partially-crossed) fixed effects
like Gender and Race?
Yes. I
Dear Lillian,
I tried to estimate parameters for time series regression using time
series bootstrapping as described on page 434 in Davison Hinkley
(1997) - bootstrap methods and their application. This approach is based
on an AR process (ARIMA model) with a regression term (compare also with
Thank you,
sorry, I forgot to mention that nls.lm is in package minpack.lm. It's
use is motivated by the wish of a colleague to reproduce a result from
some publication. But if I understand you correctly, use of the methods
implemented in nls or optim is preferred?
Prof Brian Ripley wrote:
Thank you for your replies,
But xtab(PrettyR) does something different, it computes several tables. Each
table corresponds to a different combination of the levels of the right hand
formula's variables. I only have 3 levels according to my “classification
variable” . I want to gather in a single
Guillermo,
I am dropping most of your mail because my answer is very generic.
First, why doesn't it work as you tried it: technically speaking,
coeftest() and the like expect to be feed an lm or a glm object and for
this reason won't accept the result of systemfit(), which is a much
different
On Wed, 21 Feb 2007, Michael Dondrup wrote:
Thank you,
sorry, I forgot to mention that nls.lm is in package minpack.lm. It's
use is motivated by the wish of a colleague to reproduce a result from
some publication. But if I understand you correctly, use of the methods
implemented in nls or
This really is the wrong list for C programming questions related to R.
See the posting guide and consider R-devel.
See also the debugging advice in 'Writing R Extensions'.
Almost certainly your C code has destroyed R structures, most likely by
writing outside array bounds. Running under
On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote:
Well, the algorithm used does not affect the confidence interval (provided
it works correctly), but what is nls.ml (presumably in some package you
have not mentioned) and why would I want to use an old-fashioned
algorithm?
Dear all R users,
Is there any function to omit repeated values in a vector? Your help will be
highly appreciated.
Thanks
stat
-
Heres a new way to find what you're looking for - Yahoo! Answers
?duplicated
On 2/21/07, stat stat [EMAIL PROTECTED] wrote:
Dear all R users,
Is there any function to omit repeated values in a vector? Your help will
be highly appreciated.
Thanks
stat
-
Here's a new way to find what you're looking for - Yahoo! Answers
I believe you can add these lines before your splom() command:
super.sym - trellis.par.get(superpose.symbol)
super.sym$pch - 1:length(super.sym$pch) # change this
# to specify symbols
trellis.par.set(superpose.symbol,super.sym)
Best regards,
--- d.
x - sample(1:3, 20, TRUE)
x
# do you mean
unique(x)
# or
rle(x)$values
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:
Hi,
'unique' or its combination with 'match' if you need to keep the vector
the same length will do it:
a-c(1,2,4,2,5,5,6,7,8)
unique(a)
[1] 1 2 4 5 6 7 8
a[ which( is.na( match(1:length(a), match(unique(a),a)) ) ) ]=NA
a
[1] 1 2 4 NA 5 NA 6 7 8
This is probably not the best
Brian,
thank you for the adaptions. I tried the new version under R-2.5.0
(2007-01-23 r40560) on FreeBSD 7.0-CURRENT and got the following output.
-
#R CMD INSTALL rgl_0.70-1.tar.gz
* Installing to library '/usr/local/lib/R/library'
* Installing *source* package 'rgl' ...
checking for
It seems log2 is not used so you can just comment out the line.
I am working on a better configure script, and will have something to show
you later today.
BDR
On Wed, 21 Feb 2007, Rainer Hurling wrote:
Brian,
thank you for the adaptions. I tried the new version under R-2.5.0
(2007-01-23
Hi,
We are working on a project on forecast modeling and would like to know if
there are any examples on how to READ/WRITE to a database (e.g. PostgreSQL)
using R-Project. I do have a sample R Script which takes input as files from
a directory and writes back output files to a directory. I
David:
I ‘m trying to draw ONE table that summarize SEVERAL categorical
variables
according to one classification variable, say “sex”. The result would
look
like several contingency tables appended one to the other. All the
variables
belong to a data frame.
The summary.formula in
We are working on a project on forecast modeling and would like to know if
there are any examples on how to READ/WRITE to a database (e.g.
PostgreSQL)
using R-Project. I do have a sample R Script which takes input as files
from
a directory and writes back output files to a directory. I
Hi,
On 2/21/07, Venkatesh Mantha [EMAIL PROTECTED] wrote:
We are working on a project on forecast modeling and would like to know if
there are any examples on how to READ/WRITE to a database (e.g.
PostgreSQL)
did you have a look at the Manual R Data Import/Export? I have to admit
that I
I am trying to use apply and a list to supply names
to a set of tables I want to generate. Below is an
example that I hope mimics the larger original
problem.
EXAMPLE
aa - c( 2,2,1,1,2)
bb - c(5,6,6,7,4)
aan - c(yes, no)
bbn - c(a, b, c, d)
mynames - c(abby, billy)
mylist - list(aan, bbn);
John,
Two things. You don't need to pout the cc variable in the apply. Use
instead something like this.
apply(cc, 2, fn1, y = mylist)
But this still doesn't solve your problem. You'll need to rewrite your
function like this.
fn2 - function(x, y, i){
+ tt - table(x[, i])
+ names(tt) -
Does anyone have code for the 3F2 hypergeometric function? I am looking
for code similar to the 2F1 hypergeometric function implemented as
hyperg_2F1 in the GSL package. TIA. ---Joe
__
R-help@stat.math.ethz.ch mailing list
On 2/21/07, joerg van den hoff [EMAIL PROTECTED] wrote:
On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote:
Well, the algorithm used does not affect the confidence interval (provided
it works correctly), but what is nls.ml (presumably in some package you
have not mentioned)
I might suggest an alternative, since you seem to be creating the
underlying data set from scratch.
Create the data frame with the requisite data structures to start with
and then perform the table operations:
# First create your vectors as factors. See ?factor
aa - factor(c(2,2,1,1,2), levels
Brian,
I just tried your version rgl_0.70-2 with R-2.5.0 on FreeBSD 7.0-CURRENT
(i386) and it works!
Thank you very much for this competently and very fast help.
Next I will try if it compiles on amd64, too ...
Rainer
Prof Brian Ripley schrieb:
This looks to me like a problem in your
Hello,
It is possible to return the path of the current working R-file (in
execution)?
Thanks,
Rita Sousa.
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Mango Solutions are pleased to announce the above course in London as
part of our schedule for Q1 2007.
---
Introduction to R and R Programming - 26th-28th March 2007
I think:
getwd() is you want.
On 21/02/07, Rita Sousa [EMAIL PROTECTED] wrote:
Hello,
It is possible to return the path of the current working R-file (in
execution)?
Thanks,
Rita Sousa.
[[alternative HTML version deleted]]
__
Its not clear from your post what the framework is that you are working with
but assuming that you have sourced a file and want its name place this
fn - parent.frame(2)$ofile
# other code
in a file a.R, say, and from within R source it:
source(a.R)
This is not very safe and could
You haven't told us your OS.
Here's how I do it on Win2K with MySQL. PostgreSQL should be similar. If you
are on Linux, you should read this:
http://help.nceas.ucsb.edu/index.php/R:_Data_input/output
#download and install ODBC
driverhttp://dev.mysql.com/downloads/connector/odbc/3.51.html
I have been comparing R with other languages and systems. One peculiar feature
of R is there is no scalar. Instead, it is just a vector of length one. I
wondered how much performance penalty this deign cause, particular in
situations with many scalars in a program. Thanks.
Jason Liao,
Just another note:
rgl_0.70-2 works also for R-2.5.0 on FreeBSD 7.0-CURRENT (amd64) and for
R-2.4.1 on (i386).
Rainer
Prof Brian Ripley wrote:
This looks to me like a problem in your OpenGL, I am afraid.
I've made available a (completely unofficial) revised tarball at
Hello!
I have a doubt and i need a quick answer please!!
I need to know if its possible to get in R the mathematical equation of a
graph that you have plotted. I mean i know the y and x values, but i want
the equation that relate them and that allow me to get the graph.
This option is
On Wed, Feb 21, 2007 at 09:41:29AM -0600, Douglas Bates wrote:
On 2/21/07, joerg van den hoff [EMAIL PROTECTED] wrote:
On Wed, Feb 21, 2007 at 11:09:52AM +, Prof Brian Ripley wrote:
Well, the algorithm used does not affect the confidence interval
(provided
it works correctly), but what
On Wed, 2007-02-21 at 18:20 +, ainhoaº lezama wrote:
Hello!
I have a doubt and i need a quick answer please!!
I need to know if its possible to get in R the mathematical equation of a
graph that you have plotted. I mean i know the y and x values, but i want
the equation that relate
A reviewer recently remarked to me that, due to my data being
constrained to not fall below zero, a generalized linear model with a
negative binomial error (or poisson) with a log link would be more
appropriate for fitting my model. I ran it in R with glm.nb() and
got results that matched
XLSolutions Corporation is proud to announce our March 2007 R/S:
Fundamentals and Programming Techniques - in Princeton March 1-2, 2007
: http://www.xlsolutions-corp.com/Rfund.htm
This two-day beginner to intermediate R/S-plus course focuses on a broad
spectrum of topics, from reading raw
the function 'choose.files()' won't work on my mac version of R
Does anyone know of a comparable function?
Thanks,
Matt
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Dear list,
I was wondering if it is possible to get the p-values for one-sided tests on
the parameters of a linear regression.
For instance, I use lm() and store the result in an object. lm() gives me a
matrix, using summary() and coef() on which gives me a matrix containing the
No, coxph does not have any special code to deal with ordered factors.
You can do it by hand by using the pool-adjacent-violators algorithm
1. Fit the data with stage as a categorical
2. Verify that the coefficients are ordered
if so, you are done
if not, assume that they
On Wed, 2007-02-21 at 11:49 -0800, Matthew Bridgman wrote:
the function 'choose.files()' won't work on my mac version of R
Does anyone know of a comparable function?
Thanks,
Matt
choose.files() is Windows specific.
Look at ?file.choose which should be available otherwise.
HTH,
Marc
FWIW, Debian had working rgl packages since March 2004 -- version 0.64.
So I respectfully disagree with the general state of despair regarding
the source package. I had my build issues at times, but Daniel and
Duncan worked hard and diligently to overcome these.
Hence, apt-get install
On Wed, 21 Feb 2007, Ranjan Maitra wrote:
I was wondering if it is possible to get the p-values for one-sided
tests on the parameters of a linear regression.
For instance, I use lm() and store the result in an object. lm() gives
me a matrix, using summary() and coef() on which gives me a
Yes, of course! Thank you. So, I guess the answer is that R itself can not be
made to do so directly.
Many thanks for confirming this.
Sincerely,
Ranjan
On Wed, 21 Feb 2007 20:23:55 + (GMT) Prof Brian Ripley [EMAIL PROTECTED]
wrote:
On Wed, 21 Feb 2007, Ranjan Maitra wrote:
I was
Hi folks,
If you know of any upcoming R Advanced Programming in the West Coast - USA,
please let me know.
Thanks - Tim
-
Need Mail bonding?
-
Never Miss an Email
[[alternative HTML version deleted]]
Hi Folks,
Picking up on an old thread from 2004... has anyone managed to get a version of
R runnning under Windows Mobile 5.0/Pocket PC ?
best,
Tolga
==
Please access the attached hyperlink for an important
Quoting Ranjan Maitra [EMAIL PROTECTED]:
Yes, of course! Thank you. So, I guess the answer is that R itself
can not be made to do so directly.
Many thanks for confirming this.
Sincerely,
Ranjan
On Wed, 21 Feb 2007 20:23:55 + (GMT) Prof Brian Ripley
[EMAIL PROTECTED] wrote:
Thanks to the many folks who responded, and apologies for being so dense!
The different behavior between windows and linux relative to install
defaults tripped me up. I had not thought about the dependencies switch.
All working fine now.
Cheers,
=Randy=
R. Zelick
Dirk,
I agree with you. My statements were only related to rgl on FreeBSD.
With the changes from Brian since yesterday I am finally able to compile
and work with this package on all our FreeBSD scientific desktops.
At the same time I am very conscious about the great job of Daniel and
Duncan.
Hello all,
I am doing a Likelihood Ratio (LR) test in my simulation and I have a vector
LR values (each with 1 degree of freedom) at the end of my simulation.
Can anybody tell me how I can write a 'R' code which gives me the p-value
for each of those LR values.
Thanks
[[alternative HTML
I have a data frame called df which has about 100 columns but thousands of
rows. I set D the index of df$D and M to be the index of df$M.
When I run the following loop as it is vs. df[,D] and df[,M] replaced with
df$D and df$M there is a real big time difference in completion (with the
latter
My apologies for the tremendously tardy reply, but I ran into a
similar problem and discovered findInterval and colorRampPallet
as an alternative and though it might be worthy of a RSiteSearch() result
for someone.
?findInterval
?colorRampPalette
jet.colors -
I would like to estimate bivariate VAR(X) models where I don't know the
optimal lag length X and would also like to use
F-tests to determine the granger causality of each of the variables. I'm
aware of Achim's econometric packages description but I was wondering if
someone could recommend a
Hi,
I install rJava in linux. The installation, from source, is ok. But I have
this error on load package.
library(rJava)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared
library '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot
Ignore my message,
Now it work.
Thanks and sorry.
Ronaldo
--
Nunca tente ensinar um porco cantar. Voce perde seu tempo e ainda chateia o
porco!
--
Prof. Ronaldo Reis Júnior
| .''`. UNIMONTES/Depto. Biologia Geral/Lab. Ecologia Evolutiva
| : :' : Campus Universitário Prof. Darcy Ribeiro,
What are D and M? 'Index' here could be a number or a name.
In either case, df[[D]] would be the equivalent of df$D.
However, your computation does not need a loop at all, let alone two.
Try something like
tmp - with(df, paste(D, m))
dates - unique(tmp)
On Wed, 21 Feb 2007, Alp ATICI wrote:
I am trying to make the following Kalman filter equations work and therefore
produce their graphs.
v_t=y_t - a_t
a_t+1=a_t+K_t*v_t
F_t=P_t+sigma.squared.epsilon
P_t+1=P_t*(1-K_t)+sigma.squared.eta
K_t=P_t/F_t
Given:
a_1=0,P_1=10^7,sigma.squared.epsilon=15099,
sigma.squared.eta=1469.1
I have
For what it's worth, I've been getting the exact same error message
as in the previous thread (see http://tolstoy.newcastle.edu.au/R/e2/
help/07/02/10269.html etc.):
Error in if (any(sd 0)) return('sd' slot has negative entries) :
missing value where TRUE/FALSE needed
as well as
If your data are continuous but must be positive,
consider a gamma or inverse gaussian glm.
If your data are non-negative (is positive but could
include zeros), consider glms based on Tweedie
distributions. See, for example:
http://cran.ms.unimelb.edu.au/src/contrib/Descriptions/tweedie.html
Thanks Thierry, it works perfectly. And your
explanation of what sapply was doing was really
helpful.
Actually, your solution is showing me that whoever
input the data didn't stick to the coding manual by
that' another story.
--- ONKELINX, Thierry [EMAIL PROTECTED]
wrote:
John,
Two
Dear List,
Thanks to those who helped with my enquiry a few days ago.
I have a another question on loops, in this case I am trying to print out
the row of a data frame if the previous 3 values (daily values) in col5 are
in descending order. I have this loop which works, but ask whether this
Hi, R experts-
I am trying to create a function that returns a quintile (or decile) ranking
of a variable controlled by a factor. For example, suppose there are 10
people each in class A (1st graders) and class B (2nd graders). If you want
to calculate quintile rank for each class, how would you
Rose,
1- Inside your loop, you have to use F1[i], not F[i] (2 occurences). By the
way, never use F (or T) as variables in R, because it also means FALSE and TRUE.
2- Your P update must be at the end of the loop. You haven't calculated your
K[i] yet where you placed it.
y-(Nile)
Dear R users;
Is there a function in R that I can put text with proper alignments in
a fixed format. For instance, if I have three fields: A, B and C, where
both A and C are text with 3 characters and left alignment; B is a
numeric one with 2 decimals and 3 integer space digits. How can I
YIHSU CHEN wrote:
Dear R users;
Is there a function in R that I can put text with proper alignments in
a fixed format. For instance, if I have three fields: A, B and C, where
both A and C are text with 3 characters and left alignment; B is a
numeric one with 2 decimals and 3 integer
You can use 'rle' to find the 'runs' of decreasing values by looking at the
'diff'. You can change the values to get the different lengths of runs.
# generate some test data
set.seed(3)
x - runif(100)
# use 'diff' to determine if decreasing
x.dec - diff(x) 0
# use rle to find 'runs' of 3
This will likely be of interest only (if at all) to MacOSX users. I
use a particular editor called TextMate which I find particularly
suitable for pretty much any task I have to do, from Ruby to LaTeX to
R. Its R support is probably not quite up to par with ESS yet, but it
is at a decent
I have a couple if issues with the code below.
1. as.Table=TRUE has no effect
2. the minor tick marks on top of the top panels are drawn in the strips and
not on the axes.
Any ideas what's wrong? There are probably better ways to add minor tick
marks...
Thanks for any help.
Rene
On Sun, 18 Feb 2007 07:46:56 + (GMT) Prof Brian Ripley [EMAIL PROTECTED]
wrote:
On Sat, 17 Feb 2007, Ranjan Maitra wrote:
Dear list,
I have a 4-dimensional array Y of dimension 330 x 67 x 35 x 51. I have a
design matrix X of dimension 330 x 4. I want to fit a linear regression
On Thu, 2007-02-22 at 12:33 +1100, Alfonso Sammassimo wrote:
Dear List,
Thanks to those who helped with my enquiry a few days ago.
I have a another question on loops, in this case I am trying to print out
the row of a data frame if the previous 3 values (daily values) in col5 are
in
Ranjan Maitra napsal(a):
On Sun, 18 Feb 2007 07:46:56 + (GMT) Prof Brian Ripley [EMAIL
PROTECTED] wrote:
On Sat, 17 Feb 2007, Ranjan Maitra wrote:
Dear list,
I have a 4-dimensional array Y of dimension 330 x 67 x 35 x 51. I have a
design matrix X of dimension 330 x 4. I want to fit
78 matches
Mail list logo