Thanks Paul.
I'm still struggeling with some beginners issues on the ps-import
(windows troubles with installing ghostscript), but when I resolved
them I'm sure that I can use your example code which loos great to me.
Thanks a lot,
Thomas
2009/11/4 Paul Murrell p.murr...@auckland.ac.nz:
Hi
ok,I understand your means, maybe PLS is better for my aim. but I have done
that, also bad. the most questions for me is how to select less variables
from the independent to fit dependent. GA maybe is good way, but I do not
learn it well.
Ben Bolker wrote:
bbslover dluthm at yeah.net writes:
Hi,
Why, when I run the script below, is my y-axis range command being ignored?
I.e., the y axis graphed consistently fits the line specified in the plot
command, but never fits the line I'm trying to add in the subsequent line
command.
This is my first R script, so if I'm doing anything else
Le dimanche 08 novembre 2009 à 00:05 +0100, Christian Lerch a écrit :
Dear list members,
I try to simulate an incomplete block design in which every participants
receives 3 out of 4 possible treatment. The outcome in binary.
Assigning a binary outcome to the BIB or PBIB dataset of the
Sigmund Freud wrote:
Hello:
I am trying to understand the method 'hatvalues(...)', which returns something similar to the diagonals of the plain vanilla hat matrix [X(X'X)^(-1)X'], but not quite.
A Fortran programmer I am not, but tracing through the code it looks like perhaps some sort of
Hi everyone,
I'm struggling with a little problem for a while, and I'm wondering if
anyone could help...
I have a dataset (from retailing industry) that indicates which brands
are present in a panel of 500 stores,
store , brand
1 , B1
1 , B2
1 , B3
2 , B1
2 , B3
3 , B2
3 , B3
3 , B4
I would
Not sure what you mean.
yi - c(2,3,2,4,3,6)
xi - c(1,4,3,2,4,5)
res - lm(yi ~ xi)
hatvalues(res)
X - cbind(1, xi)
diag( X%*%solve(t(X)%*%X)%*%t(X) )
Same result.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31
On Nov 8, 2009, at 8:38 AM, sylvain willart wrote:
Hi everyone,
I'm struggling with a little problem for a while, and I'm wondering if
anyone could help...
I have a dataset (from retailing industry) that indicates which brands
are present in a panel of 500 stores,
store , brand
1 , B1
1 ,
Dan, with base graphics, the plot command determines the ylim, lines can
only add lines/points to an exisiting graph, it cannot modify the existing
ylim.
You have two choices. 1) Before proceeding to the graph, determine which of
the two data sets has the greater range and call plot with that
On Nov 8, 2009, at 9:11 AM, David Winsemius wrote:
On Nov 8, 2009, at 8:38 AM, sylvain willart wrote:
Hi everyone,
I'm struggling with a little problem for a while, and I'm wondering
if
anyone could help...
I have a dataset (from retailing industry) that indicates which
brands
are
Good morning
I just got a new computer with Windows 7. R works fine, but the editor I am
used to using RWinEdt does not. I did find one blog post on how to get
RWinEdt to work in Windows 7, but I could not get those instructions to work
either.
Is there a patch for RWinEdt?
If not, is
HI R-Users
Assume that I have a data frame 'temp' with several variables (v1,v2,v3,v4,v5.).
v1 v2 v3 v4 v5
1 2 3 36
5 2 420
2 -9 5 43
6 2 1 34
1, I want to look at the entire row values of when v2 =-9
like
2 -9 5 43
I
Aha, what is that blog post and what does not work for you?
I haven't got any report so far and do not have Windows 7 easily
available yet.
Best,
Uwe Ligges
Peter Flom wrote:
Good morning
I just got a new computer with Windows 7. R works fine, but the editor I am used to
using RWinEdt
my code is not right below:
rm(list=ls())
#define data.frame
a=c(1,2,3,5,6); b=c(1,2,3,4,7); c=c(1,2,3,4,8); d=c(1,2,3,5,1);
e=c(1,2,3,5,7)
data.f=data.frame(a,b,c,d,e)
#backup data.f
origin.data-data.f
#get correlation matrix
cor.matrix-cor(origin.data)
#backup
Hi Henrik,
I am using your saveObject/loadObject to handle over 1000 matrices. It
worked beautifully. Because I need to load those matrices often for
evaluating a few functions on them and those matrices do not fit all in
memory at once, is there a way to speed up the loading part? I tried save
Thanks a lot for those solutions,
Both are working great, and they do slightly different (but both very
interesting) things,
Moreover, I learned about the length() function ... one more to add to
my personal cheat sheet
King Regards
2009/11/8 David Winsemius dwinsem...@comcast.net:
On Nov 8,
I'm wondering which textbook discussed the various contrast matrices
mentioned in the help page of 'contr.helmert'. Could somebody let me
know?
BTW, in R version 2.9.1, there is a typo on the help page of
'contr.helmert' ('cont.helmert' should be 'contr.helmert').
Dear All,
I have just installed a fresh Debian testing (squeeze) on my system
(amd64 architecture).
I am experiencing some really strange problems in updating my system
whenever I have both the R repository and the multimedia repository
available.
This is my source.list (when I disable the
Dear all,
Please help me with the R code which compute SCHEFFE TEST
Thanking you in advance
Kind regards
Mangalani Peter Makananisa
Statistical Analyst
South African Revenue Service (SARS)
Segmentation and Research : Data Modelling
Tel: +2712 422 7357
Cell: +2782 456 4669
Dear all,
Please help me with the R code which compute SCHEFFE TEST
Thanking you in advance
Kind regards
Mangalani Peter Makananisa
Statistical Analyst
South African Revenue Service (SARS)
Segmentation and Research : Data Modelling
Tel: +2712 422 7357
Cell: +2782 456 4669
Dear Prof,
Please help me with the R code which compute SCHEFFE TEST
Thanking you in advance
Kind regards
Mangalani Peter Makananisa
Statistical Analyst
South African Revenue Service (SARS)
Segmentation and Research : Data Modelling
Tel: +2712 422 7357
Cell: +2782 456 4669
Mangalani Peter Makananisa would like to recall the message, Scheffe test.
Please Note: This email and its contents are subject to our email legal notice
which can be viewed at http://www.sars.gov.za/Email_Disclaimer.pdf
[[alternative HTML version deleted]]
Here is how to find out which rows contain -9 and then you can do with
it as you please:
x
v1 v2 v3 v4 v5
1 1 2 3 3 6
2 5 2 4 2 0
3 2 -9 5 4 3
4 6 2 1 3 4
which(apply(x, 1, function(.row) any(.row == -9)))
[1] 3
On Sun, Nov 8, 2009 at 10:23 AM, Ashta sewa...@gmail.com
On Nov 8, 2009, at 11:03 AM, Peng Yu wrote:
I'm wondering which textbook discussed the various contrast matrices
mentioned in the help page of 'contr.helmert'. Could somebody let me
know?
My version of Modern Applied Statistics in S (aka MASS) deals with
it in enough detail for a person
On 8 November 2009 at 17:05, Lorenzo Isella wrote:
| I am experiencing some really strange problems in updating my system
| whenever I have both the R repository and the multimedia repository
| available.
[...]
| deb http://cran.ch.r-project.org/bin/linux/debian lenny-cran/
This URLs doesn't
On Nov 8, 2009, at 10:23 AM, Ashta wrote:
HI R-Users
Assume that I have a data frame 'temp' with several variables
(v1,v2,v3,v4,v5.).
v1 v2 v3 v4 v5
1 2 3 36
5 2 420
2 -9 5 43
6 2 1 34
1, I want to look at the entire row values of when v2
try this:
temp.new - temp[temp$v2 != -9, ]
temp.new
I hope it helps.
Best,
Dimitris
Ashta wrote:
HI R-Users
Assume that I have a data frame 'temp' with several variables (v1,v2,v3,v4,v5.).
v1 v2 v3 v4 v5
1 2 3 36
5 2 420
2 -9 5 43
6 2 1 3
On Nov 8, 2009, at 11:08 AM, David Winsemius wrote:
On Nov 8, 2009, at 10:23 AM, Ashta wrote:
HI R-Users
Assume that I have a data frame 'temp' with several variables
(v1,v2,v3,v4,v5.).
v1 v2 v3 v4 v5
1 2 3 36
5 2 420
2 -9 5 43
6 2 1 34
1, I
I'm not quite sure I understood the second queston but does this work?
subset(temp, xx$v2==-9)
subset(temp, xx$v2!= -9)
--- On Sun, 11/8/09, Ashta sewa...@gmail.com wrote:
From: Ashta sewa...@gmail.com
Subject: [R] look up and Missing
To: r-h...@stat.math.ethz.ch
Received: Sunday, November
On Sun, Nov 08, 2009 at 10:31:12AM -0600, Dirk Eddelbuettel wrote:
On 8 November 2009 at 17:05, Lorenzo Isella wrote:
| I am experiencing some really strange problems in updating my system
| whenever I have both the R repository and the multimedia repository
| available.
[...]
| deb
Hi,
I am routinely compiling a package and since I have moved to R 2.10.0,
it troncates some section texts in the doc:
With the following section in the rd file:
\details{
The function calls gpsbabel via the system. The gpsbabel program must
be present and on the user's PATH for the
With xx as your sample data will this work? See ?addmargins
jj - table(xx)
addmargins(jj, 2)
# or for both margins
addmargins(jj, c(1,2))
or
apply(jj, 1, sum)
--- On Sun, 11/8/09, sylvain willart sylvain.will...@gmail.com wrote:
From: sylvain willart sylvain.will...@gmail.com
Subject:
On Sun, Nov 8, 2009 at 11:59 AM, Peng Yu pengyu...@gmail.com wrote:
On Sun, Nov 8, 2009 at 10:11 AM, Duncan Murdoch murd...@stats.uwo.ca wrote:
On 08/11/2009 11:03 AM, Peng Yu wrote:
I'm wondering which textbook discussed the various contrast matrices
mentioned in the help page of
Gabor Grothendieck wrote:
On Sun, Nov 8, 2009 at 11:59 AM, Peng Yu pengyu...@gmail.com wrote:
On Sun, Nov 8, 2009 at 10:11 AM, Duncan Murdoch murd...@stats.uwo.ca wrote:
On 08/11/2009 11:03 AM, Peng Yu wrote:
I'm wondering which textbook discussed the various contrast matrices
mentioned in
On 08/11/2009 12:07 PM, Patrick Giraudoux wrote:
Hi,
I am routinely compiling a package and since I have moved to R 2.10.0,
it troncates some section texts in the doc:
With the following section in the rd file:
\details{
The function calls gpsbabel via the system. The gpsbabel program must
Eric Fail wrote:
Dear list users
How is it possible to visualise both a linear trend line and a quadratic trend
line on a plot
of two variables?
Here my almost working exsample.
data(Duncan)
attach(Duncan)
plot(prestige ~ income)
abline(lm(prestige ~ income), col=2, lwd=2)
Now
Duncan Murdoch a écrit :
On 08/11/2009 12:07 PM, Patrick Giraudoux wrote:
Hi,
I am routinely compiling a package and since I have moved to R
2.10.0, it troncates some section texts in the doc:
With the following section in the rd file:
\details{
The function calls gpsbabel via the system.
Thanks a lot for your explanation. That actually makes sense.
On Sat, Nov 7, 2009 at 3:54 PM, Duncan Murdoch murd...@stats.uwo.ca wrote:
On 07/11/2009 6:31 PM, Ivan wrote:
Well, the problem is that I want those console to be from the same session
(i.e., they share same objects etc.). I do
Hi all,
Is there a tool in base R to extract matched expressions from a
regular expression? i.e. given the regular expression (.*?) (.*?)
([ehtr]{5}) is there a way to extract the character vector c(one,
two, three) from the string one two three ?
Thanks,
Hadley
--
http://had.co.nz/
Hi,
I would like to fit Logit models for ordered data, such as those
suggested by Greene (2003), p. 736.
Does anyone suggests any package in R for that?
By the way, my dependent variable is ordinal and my independent
variables are ratio/intervalar.
Thanks,
Iuri.
Greene, W. H. Econometric
Hello,
I have written a simple Metropolis-Hastings MCMC algorithm for a
binomial parameter:
MHastings = function(n,p0,d){
theta = c()
theta[1] = p0
t =1
while(t=n){
phi = log(theta[t]/(1-theta[t]))
phisim = phi + rnorm(1,0,d)
I have two related variables, each with 16 points (x and Y). I am given
variance and the y-intercept. I know how to create a regression line and
find the residuals, but here is my problem. I have to make a loop that uses
the seq() function, so that it changes the slope value of the y=mx + B
Ive got a big column of dates (also some fields dont have a date so they
have NA instead),
that i have converted into date format as so...
dates-as.character(data[,date_commissioned]); # converted dates to
characters
dates[1:10]
[1] 19910101 19860101 19910101 19860101 19910101 19910101
Many thanks, Bill and Emmanuel!
Christian
Emmanuel Charpentier schrieb:
Le dimanche 08 novembre 2009 à 00:05 +0100, Christian Lerch a écrit :
Dear list members,
I try to simulate an incomplete block design in which every participants
receives 3 out of 4 possible treatment. The outcome in
What is the frame of reference to determine the age? Check out 'difftime'.
On Sun, Nov 8, 2009 at 1:50 PM, frenchcr frenc...@btinternet.com wrote:
Ive got a big column of dates (also some fields dont have a date so they have
NA instead),
that i have converted into date format as so...
To answer my own question:
The package mvtBinaryEP was helpful!
Christian Lerch schrieb:
Dear All,
I try to simulate correlated binary data for a clinical research project.
Unfortunately, I do not come to grips with bindata().
Consider
corr-data.frame(ID=as.factor(rep(c(1:10), each=5)),
Is this what you want:
x - ' one two three '
y -
sub(.*?([^[:space:]]+)[[:space:]]+([^[:space:]]+)[[:space:]]+([ehrt]{5}).*,
+ \\1 \\2 \\3, x, perl=TRUE)
unlist(strsplit(y, ' '))
[1] one two three
On Sun, Nov 8, 2009 at 1:51 PM, Hadley Wickham had...@rice.edu
First of all, allocate 'theta' to be the final size you need. Every
time through your loop you are extending it by one, meaning you are
spending a lot of time copying the data each time. Do something like:
theta - numeric(n)
and then see how fast it works.
On Sun, Nov 8, 2009 at 2:11 PM, Jens
Try this:
Instead of:
theta = c()
use:
theta - rep(NA, 50)
or however many iterations you want the algorithm to run.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31 (0)43 388-2277
School for Public Health
strapply in the gsubfn package can do that. It applies the indicated
function, here just c, to the back references from the pattern match
and then simplifies the result using simplify. (If you omit simplify
here it would give a one element list like strsplit does.)
library(gsubfn)
pat - (.*?)
As Jim has noted, if the dates you have below are an 'end date', you
need to define the time0 or start date for each to calculate the
intervals. On the other hand, are the dates you have below the start
dates and you need to calculate the time to today? In the latter case,
see ?Sys.Date to
Hi there,
I tried to fit a penalized spline for a continuous risk factor in
recurrent events data. I found that I can include both pspline and
frailty terms in coxph. So I use code like
fit1 - coxph(Surv(start, end, event)~pspline(age, df=0) + male +
white +frailty(id), data.all)
It
Le dimanche 08 novembre 2009 à 17:07 -0200, Iuri Gavronski a écrit :
Hi,
I would like to fit Logit models for ordered data, such as those
suggested by Greene (2003), p. 736.
Does anyone suggests any package in R for that?
look up the polr function in package MASS (and read the relevant
Thanks a lot, this works.
jim holtman wrote:
First of all, allocate 'theta' to be the final size you need. Every
time through your loop you are extending it by one, meaning you are
spending a lot of time copying the data each time. Do something like:
theta - numeric(n)
and then see how
it sure does thank you!
will this work for you
x - c('19910101', '19950302', '20010502')
today - Sys.Date()
x.date - as.Date(x, format=%Y%m%d)
round(as.vector(difftime(today , x.date, units='day') / 365.25))
[1] 19 15 9
On Sun, Nov 8, 2009 at 2:44 PM, frenc...@btinternet.com wrote:
Hello list:
I am using cut and table to obtain a frequency table from a numeric sample
vector. The idea is to calculate mean and standard deviation on grouped data.
However, I can't extract the midpoints of the class intervals, which seem to be
strings treated as factors. How do i extract
why do you use 365.25?
dates-as.character(data[,date_commissioned]); # convert dates to
characters
#dates[1:10]
#[1] 19910101 19860101 19910101 19860101 19910101 19910101
19910101 19910101 19910101 19910101
dateObs - as.Date(dates,format=%Y%m%d)
#dateObs[1:10]
#[1] 1991-01-01 1986-01-01
Hi,
Maybe something like this (inspired by ?cut),
cut2num - function(f){
labs - levels(f)
d - data.frame(lower = as.numeric( sub(\\((.+),.*, \\1, labs) ),
upper = as.numeric( sub([^,]*,([^]]*)\\], \\1, labs) ))
d$midpoints - rowMeans(d)
d
}
a - c(1, 2, 3, 4, 5, 2, 3,
jose romero wrote:
Hello list:
I am using cut and table to obtain a frequency table from a
numeric sample vector. The idea is to calculate mean and standard
deviation on grouped data. However, I can't extract the midpoints of the
class intervals, which seem to be strings treated as factors.
Try this:
library(gsubfn)
demo(gsubfn-cut)
and note the strapply call that converts the levels from cut to a matrix.
On Sun, Nov 8, 2009 at 4:08 PM, jose romero jlauren...@yahoo.com wrote:
Hello list:
I am using cut and table to obtain a frequency table from a numeric
sample vector. The
On Sun, Nov 8, 2009 at 11:28 AM, Peter Dalgaard
p.dalga...@biostat.ku.dk wrote:
Gabor Grothendieck wrote:
On Sun, Nov 8, 2009 at 11:59 AM, Peng Yu pengyu...@gmail.com wrote:
On Sun, Nov 8, 2009 at 10:11 AM, Duncan Murdoch murd...@stats.uwo.ca
wrote:
On 08/11/2009 11:03 AM, Peng Yu wrote:
On Nov 8, 2009, at 3:11 PM, frenchcr wrote:
why do you use 365.25?
As opposed to what?
--
David
dates-as.character(data[,date_commissioned]); # convert dates to
characters
#dates[1:10]
#[1] 19910101 19860101 19910101 19860101 19910101 19910101
19910101 19910101 19910101 19910101
To clarify.
Lets turn a date into an age. Given 05/29/1971 in mm/dd/
format. What is the year difference between then and today?
This would be the age requested that starts 05/29/1971 as
one.
Thanks,
Jim
David Winsemius wrote:
On Nov 8, 2009, at 3:11 PM, frenchcr wrote:
why do you
I don't understand under what situation ordered factor rather than
unordered factor should be used. Could somebody give me some examples?
What are the implications of order vs. unordered factors? Could
somebody recommend a textbook to me?
__
If I've understood correctly, you have cell sizes of 1. This is not enough.
ANOVA compares within group variance to between group variance, and
your within group variances are zero.
You need more data, or to collapse some cells.
Jeremy
2009/11/8 znd zackdaughe...@mail.com:
Hello, I'm new
Sys.Date()
[1] 2009-11-08
as.Date(05/29/1971, format = %m/%d/%Y)
[1] 1971-05-29
as.numeric((Sys.Date() - as.Date(05/29/1971, format = %m/%d/
%Y)) / 365.25)
[1] 38.44764
or perhaps more clearly:
EndDate - Sys.Date()
StartDate - as.Date(05/29/1971, format = %m/%d/%Y)
as.numeric((EndDate
Normal distribution check within R can be done with functions available in
nortest package. This package consists of several normality tests. In order
to install package type install.packages('nortest'). Afterwards, you should
consider running ks.test() only if mu and sigma parameters are known
How do you express e the base of the natural log in R.
--
View this message in context:
http://old.nabble.com/Express-%22e%22-in-R--tp26258503p26258503.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
On 08/11/2009 5:03 PM, Crab wrote:
How do you express e the base of the natural log in R.
e - exp(1)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
exp(1)
#[1] 2.718282
On Nov 8, 2009, at 5:03 PM, Crab wrote:
How do you express e the base of the natural log in R.
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
__
R-help@r-project.org mailing list
Dear Peng Yu,
Perhaps you're referring to my text, Applied Linear Regression Analysis and
Generalized Linear Models, since I seem to recall that you sent me a number
of questions about it. See Section 9.1.2 on linear contrasts for the answer
to your question.
I hope this helps,
John
Hi Rusers,
I hope to divide the original dataset into several subsets and output
these multilple datasets. But errors appeared in my loops. See example.
##
a-c(1:10)
b-c(rep(1,3),rep(2,3),rep(3,4))
c-data.frame(a,b) #c is the example data
num-c(unique(b))
# I hope to get the subsets
Ah, I believe I constructed my *.csv wrong in that I only had 1 observation
within groups whereas I needed at least 2.
Originally I had:
Year Depth Biomass1 Biomass2
1999 10 14.3 14.7
1999 15 14.7 15.6
etc.
but I switched this to:
Year
Dear John,
I did read Section 9.1.2 and various other textbooks before posting my
questions. But each reference uses slightly different notations and
terminology. I get confused and would like a description that
summaries everything so that I don't have to refer to many different
resources. May I
x
Year Depth Biomass1 Biomass2
1 199910 14.3 14.7
2 199915 14.7 15.6
require(reshape)
melt(x, id=c('Year','Depth'))
Year Depth variable value
1 199910 Biomass1 14.3
2 199915 Biomass1 14.7
3 199910 Biomass2 14.7
4 199915 Biomass2 15.6
On Sun, Nov
Have you considered using split?
-Ista
On Sun, Nov 8, 2009 at 7:23 PM, rusers.sh rusers...@gmail.com wrote:
Hi Rusers,
I hope to divide the original dataset into several subsets and output
these multilple datasets. But errors appeared in my loops. See example.
##
a-c(1:10)
Emmanuel Charpentier wrote:
Le dimanche 08 novembre 2009 à 17:07 -0200, Iuri Gavronski a écrit :
Hi,
I would like to fit Logit models for ordered data, such as those
suggested by Greene (2003), p. 736.
Does anyone suggests any package in R for that?
look up the polr function in package MASS
Dear Peng,
I'm tempted to try to get an entry in the fortunes package but will instead
try to answer your questions directly:
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
Behalf Of Peng Yu
Sent: November-08-09 7:41 PM
To:
Hi all,
I think the code to calculate the default value of the symbreaks
argument in the gplots::heatmap.2 function is wrong.
The documentation says symbreaks defaults to true if any negative
values are detected in the data passed in.
The relevant code in the parameter list of this
Hi all,
I'm using the mle.stepwise function in the wle package to run forward
selection. My statistical background tells me that the first variable
selected should be the one with the highest correlation with the response,
however that's not the case. The two highest correlations with the
On Nov 8, 2009, at 7:23 PM, rusers.sh wrote:
for (i in num) {
c_num-c[c$b==num,]
write.csv(c_num,file=c:/c_num.csv)
}
Warning messages:
1: In c$b == num :
longer object length is not a multiple of shorter object length
This is because you're comparing column b to the entire vector of
Dear R communities
May I seek your advices on how to change color the default in levelplot(), e.g.
from the default of pink and light blue, to e.g. red and green ?
The levelplot function has 1 of the arguments being panel (which is actually
panel.levelplot), but I am not sure where the
Hello,
I frequently have to export a large quantity of data from some
source (for example, a database, or a hand-written perl script) and then
read it into R. This occasionally takes a lot of time; I'm usually using
read.table(filename,comment.char=,quote=) to read the data once it is
83 matches
Mail list logo