Dear
Please unsubscribe my email from mailing list of R-Help.
Thanks
Amir Kavousi
[EMAIL PROTECTED]
-
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
__
R-help@r-proj
Eric Bell ericjbell.com> writes:
> A secondary problem is that after I do the conversion, I need to know
> what codes were converted to what numeric values.
>
Column-wise factor conversion can be handy, but often it bites.
# Assume you have the data file
m1 m2
A B
B C
C D
#---
# m
Amir Kavousi wrote:
> Dear
>
> Please unsubscribe my email from mailing list of R-Help.
>
>
Please use the unsubscription mechanism at
> https://stat.ethz.ch/mailman/listinfo/r-help
>
(near the bottom)
--
O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_
I have a TS of monthly observations.
head(data4)
1991(1) 1991(2) 1991(3) 1991(4) 1991(5) 1991(6)
12.00864 11.94203 11.98386 12.01900 12.19226 12.15488
Now I want to make 11 dummy variables indicating months. Therefore I did
followings :
For Jan :
rep(c(rep(0,0), 1, rep(0,
Hi,
How can I overlap two density plots?
A <- c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7)
B <- c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10)
plot(density(A))
plot(density(B))
Regards,
Emre
P.S. There's a overlap.density function in package DAAG
Is there another way to do th
You could use the BRugs package and formulate your prior knowledge about
slopes in terms of a probability distribution.
Michele Christina Itten kirjoitti:
> Is there a way to force certain formula parameters to be nonnegative?
>
> What I want to do is to estimate student capacity over time, na
On Fri, 25-Apr-2008 at 06:12AM +0100, Prof Brian Ripley wrote:
> Note that the problem is not that you got the message, but an apparent
> whitespace issue in the output. That's clearer in this version: note that
> the output for reg-IO.Rout.save is shifted left one column. But I don't
> trust
> GenDummyVar <- function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0,
12-NumMonth)), 17)
> NameDummy <- c("DJan", "DFeb", "DMar", "DApr", "DMay", "DJun", "DJul",
"DAug", "DSep", "DOct", "DNov", "DDec")
> for (NumMonth in 1:12) assign(NameDummy, GenDummyVar (NumMonth))
> DJan
[1] 0 0 0 0 0 0 0
Oops.. the last line should have been :
for (NumMonth in 1:12) assign(NameDummy[NumMonth], GenDummyVar (NumMonth))
On Fri, Apr 25, 2008 at 10:18 AM, N. Lapidus <[EMAIL PROTECTED]> wrote:
> > GenDummyVar <- function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0,
> 12-NumMonth)), 17)
> > NameDummy
Amir Kavousi schrieb:
> Dear
>
> Please unsubscribe my email from mailing list of R-Help.
>
> Thanks
>
> Amir Kavousi
>
> [EMAIL PROTECTED]
>
you can unsubsribe at the following page by yourself.
(including password reminder)
https://stat.ethz.ch/mailman/listinfo/r-h
Hello R users,
I am trying to estimate the parameters of a bimodal normal distribution using
moments matching, so I have to solve a non-linear system of equations. How can
I solve the following simple example?
x^2 - y^2 = 6
x – y = 3
I heard about nlsystemfit, but I don’t know how to run it e
Eric Bell wrote:
> Hello. I am a newbie to R. If I should be reading some FAQ or manual
> that could help answer my question please tell me and I will go there.
>
> Problem:
>
> I have a spreadsheet that contains a character code in each cell. The
> columns in the spreadsheet represent time and
Hi,
is not there any way to tell grid() the starting value? With nx,ny
I get the right number of grid cells, but not on the exact
values I would like them. (I know I can do it with abline(), just
asking for an easier way, i.e. grid(nx,nx,start.x,start.y))
An alternative way (which would solve anot
2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>:
> I am trying to estimate the parameters of a bimodal normal distribution
> using moments matching, so I have to solve a non-linear system of equations.
> How can I solve the following simple example?
>
> x^2 - y^2 = 6
> x – y = 3
>
> I heard abou
"Emre Unal" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Hi,
>
> How can I overlap two density plots?
>
>
> A <- c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7)
> B <- c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10)
>
> plot(density(A))
Instead:
lines(density(B))
--
David Win
Hello Paul,
Thank you for your quick answer. I have tried to use your advice and to
estimate the parameters of beta distribution with moments matching. This is my
code:
ex <- 0.3914877
ex2 <- 0.2671597
my.mm <- function(x){
p <- x[1]
q <- x[2]
p <- .Machine$double.eps
On 4/25/2008 5:32 AM, Agustin Lobo wrote:
> Hi,
> is not there any way to tell grid() the starting value? With nx,ny
> I get the right number of grid cells, but not on the exact
> values I would like them. (I know I can do it with abline(), just
> asking for an easier way, i.e. grid(nx,nx,start.x,s
On Fri, Apr 25, 2008 at 10:57:27AM +0300, Emre Unal wrote:
>
> How can I overlap two density plots?
>
> A <- c(8,10,10,11,11,11,12,12,12,12,11,11,11,10,10,7)
> B <- c(11,13,13,14,14,14,15,15,15,15,14,14,14,13,13,10)
plot(density(A))
lines(density(B))
cu
Philipp
--
Dr. Philipp Pagel
L
Dear all,
I am currently building a package with C code (in scr folder).
Everything was ok, but now, I get the following error message when
compiling the package using R CMD INSTALL:
make[2]: *** No rule to make target 'R/Copy', needed in [...]
What does that mean? I can still compile other pack
--begin included message ---
I am using survreg(Surv()) for fitting a Tobit model of left-censored
longitudinal data. For logarithmic transformation of y data, I am trying use
survreg.distributions in the following way:
tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(id), dist="gaussian",
> x^2 - y^2 = 6
> x – y = 3
>
>
You can also try this
# function
f <- function(x) {
y <- numeric(2)
y[1] <- x[1]^2-x[2]^2-6
y[2] <- x[1]-x[2]-3
y
}
# function values transformed to scalar
# minimising fnorm this way is not the best method of finding a solution for
Try to change the initial values of the parameters with, for instance,
p0 <- rnorm(2)
But you sure that your system has a solution, Evgeniq?
Paul
2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>:
> Hello Paul,
>
> Thank you for your quick answer. I have tried to use your advice and to
> estimate
Do you have a space in some file name? Starting 'Copy '?
On Fri, 25 Apr 2008, Ardia David wrote:
> Dear all,
> I am currently building a package with C code (in scr folder).
> Everything was ok, but now, I get the following error message when
> compiling the package using R CMD INSTALL:
> make[
Paul,
This is what some of our condor files look like. The script actually
goes through and cleans out our log directory (hence the name):
--- CleanCondorLogs.condor ---
JobName = CleanCondorLogs
LogHeader = $(JobName).$(Cluster).$(Process).$$(Machine)
input = /CleanCondorL
[EMAIL PROTECTED] wrote:
> Given a data set and a set of predictors and a response in the data,
> we would like to find a model that fits the data set best.
> Suppose that we do not know what kind of model (linear, polynomial
> regression,... ) might be good, we are wondering if there is R-package(
Dear R package developers:
I need help on getting a package compiled for windows.
I am trying to use definitions and routines from a
set of libraries in that are in LINUX under
#include
#include
#include
#include
but these are unavailable in windows.
I found that we can get these by including
Clearly, a family of solutions is
(p,q) = (0,k), with k != 0.
Paul
On Fri, Apr 25, 2008 at 1:58 PM, Paul Smith <[EMAIL PROTECTED]> wrote:
> Try to change the initial values of the parameters with, for instance,
>
> p0 <- rnorm(2)
>
> But you sure that your system has a solution, Evgeniq?
>
>
Hi Radka,
The problem lies in your function my.mm(). Especially, the following lines:
p <- .Machine$double.eps
q <- .Machine$double.eps
Even if you take out these 2 lines, still the definition is not correct, I
think, since there is a trivial answer x* = c(0, q).
I am not sure how you int
Radka,
Generally, there is no need to increase `maxit' to beyond default. If you
are unable to obtain a reasonable approximation to your system within
`maxit', then you should do the following (not necessarily in that order):
1. Try a few different starting values and see if you can obtain a re
Dear all,
Hope this question is not too trivial...
In order to correct standard errors from an estimation of a fixed
effects regression model y need to extract the vector of standard errors
of the coefficients of a simple linear model estimated using
lm(var1~var2+var3+var4)
Unfortunately I ca
Try this:
> library(Ryacas)
> x <- Sym("x")
> y <- Sym("y")
> Solve(List(x^2+y^2==6, x-y==3), List(x,y))
expression(list(list(x == root(6 - y^2, 2), y == y)))
2008/4/25 Radka Pancheva <[EMAIL PROTECTED]>:
> Hello R users,
>
> I am trying to estimate the parameters of a bimodal normal distributio
Dear Developers,
The pnbeta function has been reviewed recently in the article of A.
Baharev, S. Kemény, On the computation of the noncentral F and
noncentral beta distribution, Statistics and Computing, 2008, in
press. Preprint of the paper is available here:
http://reliablecomputing.eu/publicat
The standard C define is WIN32, not Win32 (which R uses as private
define). You could have
PKG_CPPFLAGS=-DWin32
in Makevars.win, but this is unnecessary.
See e.g. Rmath.h.
On Fri, 25 Apr 2008, Jonathan Lees wrote:
> Dear R package developers:
>
> I need help on getting a package compiled for
Uli Kleinwechter <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Dear all,
>
> Hope this question is not too trivial...
>
> In order to correct standard errors from an estimation of a fixed
> effects regression model y need to extract the vector of standard
> errors of the coefficients
I realize the R developers are probably overwhelmed and have little time
for this, but the documentation really needs some serious reorganizaton.
My reply:
I'm quite new to R and so have spent a lot of time in the last few days
reading documentation both online and text. I'm incredibly impres
Hi,
Is it possible to create new vars in a loop
For instance:
for (i in 1:11)
var'i' <- assign something
output =
var1
var2
...
var11
Is there a way to combine/join the value of 'i' to the string/char var in de
loop.
--
View this message in context:
http://www.nabble.com/join-chars-in-lo
for (i in 1:11){
assign(paste('var', i, sep=''), value)
}
On Fri, Apr 25, 2008 at 10:40 AM, Dirkheld <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is it possible to create new vars in a loop
>
> For instance:
>
> for (i in 1:11)
> var'i' <- assign something
>
> output =
> var1
> var2
> ...
> var11
>
Try:
summary(lm.D9)[["coefficients"]][,2]
On Fri, Apr 25, 2008 at 10:55 AM, Uli Kleinwechter <
[EMAIL PROTECTED]> wrote:
> Dear all,
>
> Hope this question is not too trivial...
>
> In order to correct standard errors from an estimation of a fixed
> effects regression model y need to extract th
look at ?assign(), e.g.,
for (i in 1:11) {
assign(paste("var", i, sep = ""), i)
}
var1
var2
var10
but I'd prefer to use a list. I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, L
You may want to read the help page for '[' and '[[' a few more times
(the differencese can be subtle).
The '[[' only returns a single element from a data structure (but in the
case of a list, that single element can be quite complex). So something
like list[[1:2]] does not make sense because you
No... don't think so. I rerun my computer, moved some folders (I deleted
the folder with .C file), rerun the compilation, and it worked... Not
sure to understand why.
Any idea?
Prof Brian Ripley wrote:
> Do you have a space in some file name? Starting 'Copy '?
>
> On Fri, 25 Apr 2008, Ardia Da
Or use:
mod <- lm(var1 ~ var2 + var3 + var4)
coef(summary(mod))[, 2]
or
coef(summary(lm.D9))[, "Std. Error"]
if you prefer using column names.
coef() extracts the model coefficients from the lm object and the
additional content in a summary.lm object.
There are accessor functions f
You might want to look at the distr package (and its relatives). It
provides methods for calculating the distribution function of
combinations (the sum is one) of other distributions. I'm not sure how
you would convert your percentiles to a distribution function, but there
may be a way in the doc
...
That is, use the construction
thelist <- lapply(1:11,function(i){...return something})
I would go further then Dmitris and say that this should be the canonical
answer to this frequently asked question and that perhaps in 7.21 in the R
FAQ (Version 2.6.2 -- I haven't yet upgraded) -- "How ca
Dear list-members,
a model is fit with lmer, but I want to force the variance parameter values
to be as defined by me
I thought, use 'start' to specify initial values and only allow for one
iteration ?
my question is how to do that ?
to specify the 2x2 matrix of variance parameter values:
start=
Hi All,
I was using FASeg package. Now when I am trying to install this library I
get the message
Warning message:
package 'FASeg' is not available
Can someone please suggest something.
Thank you
vidhu
[[alternative HTML version deleted]]
__
R
Hi to all members,
i encountered a weird problem when trying to assign subset of rows in a
matrix.
Simple example works fine:
z<-matrix(NA,ncol=3,nrow=10)
z[,1]<-1:10
y<-matrix(1:30,ncol=3,nrow=10)
y[,1]<-5:14
z[z[,1]%in%y[,1],2]<-y[y[,1]%in%z[,1],2]
z
z[z[,1]%in%y[,1],]<-y[y[,1]%in%z[,1],]
z
W
On 4/25/08, Wilfried Cools <[EMAIL PROTECTED]> wrote:
> Dear list-members,
> a model is fit with lmer, but I want to force the variance parameter values
> to be as defined by me
> I thought, use 'start' to specify initial values and only allow for one
> iteration ?
> my question is how to do
Hello Dr. Therneau:
Thank you for your response. Let me explain to you want I want. My y
variable(time) is normal and would like to fit the model on logarithmic
transformation of y (log(y)). I tried to run codes according to your suggestion:
tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(
Hi All,
I have a .c file and I need to make a dll so that it could be called by R.
I have successfully made .so from .c file and its working great. But i have
no clue of making dll. I tried googling for help ...but not much of use
Please suggest something
regards
Vidhu
[[alternative HTM
Each pdf reference manual includes an index of functions classified
according to keywords.
I wonder why indexes in on-line documentation do not include similar
categorisation.
It would be much easier to figure out all related functions and topics.
Thanks,
Vitalie.
__
On 4/25/2008 1:12 PM, Vidhu Choudhary wrote:
> Hi All,
> I have a .c file and I need to make a dll so that it could be called by R.
> I have successfully made .so from .c file and its working great. But i have
> no clue of making dll. I tried googling for help ...but not much of use
>
> Please su
Hi Jorge,
That was great! Thank you very much for the suggestion.
I just had to make a couple of minor changes (e.g., pearson vs. spearman)
and it worked perfectly.
Thanks,
Joao Pedro
Hi,
I'm sure it could be better but try this:
# F statistics based on lm
FSTAT=function(y,x) summary(lm(y~
This is fantastic.
As a future note to myself and to others who may stumble upon this:
further documentation for all one's heart could desire is in the base
help system at.
Regular Expressions as used in R - regexp
Pattern Matching and Replacement - grep
Split the Elements of a Character Vector
This is a reply to Luke Spadavecchia's question about hist densities.
If you want to construct a histogram where the bar heights are the
percentage of observations in the intervals you can use this code:
x<-rnorm(n=5000,mean=1.5,sd=0.25)
h<-hist(x)
h$density<-h$counts/sum(h$counts)
plot(
The simplest way is probably to generate them as the columns of a
matrix. Let's suppose you have data from Jan 1991 up to Mar 2008.
> X <- outer(rep(month.abb, length = 16*12+3), month.abb, "==") + 0
> ## the "+ 0" will convert logical to numeric
> dim(X)
[1] 195 12
> dimnames(X)[[2]] <- mont
Can somebody tell me how to do the equivalent of a pivot table in R ?
For example, if I have :
var1var2 var3
a x10
b y20
a z10
b z20
a z10
b z20
I could have :
x y z
a
Hi,
Try this:
x="var1var2 var3
a x10
b y20
a z10
b z20
a z10
b z20"
yourdata=read.table(textConnection(x),header=TRUE)
attach(yourdata)
res=tapply(var3,yourdata[,-3],sum) # With tapply!
res[is
See Hadley's reshape package http://had.co.nz/reshape/
and on CRAN.
On Fri, Apr 25, 2008 at 2:54 PM, ppaarrkk <[EMAIL PROTECTED]> wrote:
>
> Can somebody tell me how to do the equivalent of a pivot table in R ?
>
>
> For example, if I have :
>
> var1var2 var3
> a x10
> b
Try:
with(x, tapply(var3, list(var1, var2), length))
with(x, tapply(var3, list(var1, var2), sum))
Or with xtabs
xtabs(as.logical(var3) ~ var1 + var2, data = x)
xtabs(var3 ~ var1 + var2, data = x)
On 4/25/08, ppaarrkk <[EMAIL PROTECTED]> wrote:
>
>
> Can somebody tell me how to do the equiv
Greg Snow wrote:
> The '[[' only returns a single element from a data structure
I know but that is precisely what I find arbitrary.
Anyway you are right that it would still return the kind of object, only
subsetted, which is not I want. As someone kindly pointed out to me
offline, besides the u
Hi !
I have installed R-2.7.0 64-bits on a computer where the new Ubuntu
version (8.04) was installed. This computer is a 3.2 GHz Dual-core with
2 Gb of RAM.
To test how fast (I though !) this machine is, I compared two simple
matrix manipulations between Ubuntu and my laptop (a MacBook Pro 2.
Hi,
I forgot the first part (I'm sorry):
table(var1,var2)
var2
var1 x y z
a 1 0 2
b 0 1 2
HTH,
Jorge
On Fri, Apr 25, 2008 at 7:25 PM, Jorge Ivan Velez <[EMAIL PROTECTED]>
wrote:
>
> Hi,
>
> Try this:
>
> x="var1var2 var3
> a x10
> b y20
> a
First generate a factor and then calculate its model matrix:
month. <- factor(cycle(x), labels = month.abb)
model.matrix(~ month.)[,-1]
Actually you may not even need the dummy variables at all if your
purpose is to do a regression. You can use the factor
directly:
lm(x ~ month.)
By the way, b
On Apr 25, 2008, at 4:34 PM, Guillaume Blanchet wrote:
> Hi !
>
> I have installed R-2.7.0 64-bits on a computer where the new Ubuntu
> version (8.04) was installed. This computer is a 3.2 GHz Dual-core
> with
> 2 Gb of RAM.
>
> To test how fast (I though !) this machine is, I compared two simp
Hi, I have a question about predicting new values from a fitted model in R.
For example, if i fit a linear model
fit<-lm(y~x)
predict(fit) will give the fitted values for each x.
I am wondering if there is a way to do some prediction of the fitted for
some new values of x that are not in the d
Hi Lisa,
See examples in ?predict.lm
HTH,
Jorge
On Fri, Apr 25, 2008 at 7:47 PM, Lisa <[EMAIL PROTECTED]> wrote:
> Hi, I have a question about predicting new values from a fitted model in R.
>
> For example, if i fit a linear model
>
> fit<-lm(y~x)
>
> predict(fit) will give the fitted value
Hi :-)
I'm new to R and I started using it for a project (I'm the CS guy in a group
of statisticians helping them find out how to solve issues as they come out).
This is my first post to the list and I am starting to learn R.
Well, they were used to doing MCA analysis in other programs where the
Hello,
I've recently been using the nnet package to do some basic forecast
predictions. I've found the package to be quite useful and I am
getting some good results. However, I am in the midst of writing a
small paper on the results I am getting and wish to clarify some
things about the nn
Hello,
I am using the clogit (conditional logistic regression) on a simple data set
which is not related to survivorship, which I understand to be fine.
I have trouble understanding the output. I would like to find parameter
estimates of the logistic models I am constructing with R, and am u
Hi,
1) I ran a script say test.R. It ran and terminated with an error. However,
I am not sure where the error occur.
> source("test.R")
Loading required package: tools
Welcome to Bioconductor
Vignettes contain introductory material. To view, type
'openVignette()'. To cite Bioconductor, see
When it stops with the error you can issue a
traceback()
command or run the script with echo=TRUE:
source("test.R", echo = TRUE, max = 1000)
On Fri, Apr 25, 2008 at 11:28 PM, Ng Stanley <[EMAIL PROTECTED]> wrote:
> Hi,
>
> 1) I ran a script say test.R. It ran and terminated with an error. Howe
Hi Jorge,
thank you very much for your reply. I checked and have got the prediction
of new values for lm or glm or nls, the new question is, is there any
prediction for the cox model? I tried predict(Surv(y~x),newdata), it only
gave the fitted values. Any clue on this? thanks a lot!
On 4/25/08,
73 matches
Mail list logo