Thanks, Thierry and other R users.
I estimate the model using the factor rather than the dummy variables I used
previously. It still takes forever for the function lme to run. But lmer
is much better with my large data size (about 60,000 observations).
The interesting part is that the results from
No its not an or condition. Please see the changed attachment.
Many thanks for your help.
Regards
Meenu
On Wed, Aug 5, 2009 at 6:36 PM, David Winsemius dwinsem...@comcast.netwrote:
On Aug 4, 2009, at 2:12 PM, Meenu Sahi wrote:
Dear R Users
I'm writing my first simulation in R.
I've put
Interesting. While this will work for a single site, however, for multiple
sites or other grouping variables, I'm left with the same problem of
efficiently going from one data from to the other.
David Winsemius wrote:
library(zoo)
?rollmean
David Winsemius, MD
Heritage
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Here is a particularly perplexing example:
v - 0:10
v
[1] 0 1 2 3 4 5 6 7 8 9 10
class(v)
[1] integer
v[1] - 0
class(v)
[1] numeric #!!
--
View this message in context:
PDXRugger wrote:
Please consider the following inputs:
PrsnSerialno-c(735,1147,2019,4131,4131,4217,4629,4822,4822,5979,5979,6128,6128,7004,7004,
7004,7004,7004,7438,7438,9402,9402,9402,10115,10115,11605,12693,12693,12693)
On Wed, 2009-08-05 at 13:16 -0700, Steve Jaffe wrote:
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Here is a particularly perplexing example:
v - 0:10
v
[1] 0 1 2 3 4 5 6 7 8 9 10
class(v)
[1] integer
v[1] - 0
try this:
v -
Thank you very much for the answer. I just solved the problem by writing a
loop for grep(), so that R runs through the ID list one by one. Probably it
is not the ideal method, but still I can now proceed to further work.
William Dunlap wrote:
-Original Message-
From:
Hi, I'm new to R language.
There is a problem I couldn't understand.
Hope you can answer my question.
when i type
for (i in 1:10){
+ print(sample(9,4,replace=T))
+}
and it shows ten of four numbers
and how do I do to calculate the frequencies in each list?
I know there is
On 8/5/2009 4:16 PM, Steve Jaffe wrote:
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Because 0 is a numeric constant, not an integer constant. R doesn't
check the value, only the type: it's just as if you assigned 3.14159 to
that element as far as
Try:
library(MASS)
mahalanobis(x,y,ginv(S),inverted=TRUE)
--
View this message in context:
http://www.nabble.com/mahalanobis-distance-tp24569511p24831389.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
First, this has nothing to do with 0. Assigning 1000 to an element of v
would also have this effect. Two, the first element of a vector is indexed by
1, not 0. While what you wrote isn't a syntax error (v[0] - 0), it may be
not doing what you think, but I don't know.
Finally, the answer to
I have a list of IDs like this:
AB1234
AB4567
AB8901
In my dataset, there are IDs like this:
AB
AB /// AB1234
AB4567 /// AB8901 /// AB
I used grep(list$ID, dataset$ID, value=T)
It returned only one match, which was the very first match AB ///
AB1234. It seems once the first
On Wed, 5 Aug 2009, Deepayan Sarkar wrote:
On 8/5/09, Jacob Wegelin jacob.wege...@gmail.com wrote:
I would like to use lattice graphics to plot multiple functions (or
groups
or subpopulations) on the same plot region, using different line types
lty
or colors col to distinguish the functions
To insert values with SQL: INSERT INTO table_name VALUES (value1, value2,
value3,...).
To deal with those date problems Im almost sure that R has a Date Function
somewhere in its manual. You should take a look.
Just the best help I can give, sorry
good look
JoK LoQ wrote:
Hi,
Im
Pesumably because v[1] - 0 give a numeric result, then the rest of v is
coerced into numeric.
Observe
v - 0:10
class(v)
v[1] - as.integer(0)
class(v[1])
class(v)
--- On Wed, 8/5/09, Steve Jaffe sja...@riskspan.com wrote:
From: Steve Jaffe sja...@riskspan.com
Subject: [R] why is 0 not an
In particular, try this:
library(zoo)
a.wide - reshape(a.df, dir = wide, timevar = dates, idvar = sites)
rollmean(as.zoo(t(a.wide[,-1])), 2)
1 56.855685 58.62981 95.14842
2 58.049821 58.81659 78.70020
3 11.199634 89.91179 76.22853
4 1.152741 43.6 93.03040
On Wed, Aug 5, 2009 at 3:05
try
x - 0
class(x)
[1] numeric
x - 0L
class(x)
[1] integer
You have to explicitly indicate that you want integer.
On Wed, Aug 5, 2009 at 4:16 PM, Steve Jaffesja...@riskspan.com wrote:
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Here is a
Jim,
Thank you very much for providing this information.
Within Plotrix does there also exist the possibility of having two plots share
the same x-axis, but have one plot above the other plot. That is, essentially
do the same thing as twoord.plot, but instead put the right y values in a
Dear all,
I am attempting to convert 10 NetCDF files into a single NetCDF file, due to
the data input requirements of a model I hope to use. I am using the ncdf
package, version 1.6. The data are global-scale water values, on a monthly
basis for 10 years (ie. 120 months of data in total; at
I recently downloaded an XLS file from a web site into a data.frame.
You may want to try out the following:
?install.packages(gdata)
library(gdata)
?read.xls
Maura
-Messaggio originale-
Da: r-help-boun...@r-project.org per conto di Inchallah Yarab
Inviato: mer 05/08/2009 17.56
A:
In my continuing quest to generate some summary data, I've come across
some useful suggestions in pasts posts.
The apply operation returns an error, and I can't figure out why.
Can someone help me fix this?
testlogdata - cbind(testlogdata, range_group=cut(testlogdata$lrm_score,
breaks=c(.9,
I have a question related to scoping. Suppose we have 2 functions:
f1 = function(i){i = 1}
f2 = function(n){
i = length(n)
f1(i)
}
In other words, I would like i=1 regardless of n. Is this possible without
having f1 in the body of f2? Thanks in advance!
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Gina Liao
Sent: Wednesday, August 05, 2009 7:15 AM
To: r-h...@stat.math.ethz.ch
Subject: [R] hi, i have a problem in R
Hi, I'm new to R language.
There is a problem I
OK, I see how this would work for a rolling mean with continuous
observations. However, my actual problem is a bit more complex. I have a
number of observations, not necessarily evenly spaced. So, the data I'm
working with looks somewhat more like what this would produce
set.seed(2003)
hi all,
suppose I have a file with several columns, and I want to plot all points
that meet a certain condition (i.e. all points in columns A and B that have
a value greater than such and such in column C of the data) in a new but
random color. That is, I want all these points to be colored
Its not the evenly spaced that makes it work -- its that you want the
same number of observations to contribute to each mean even if they
are not equally spaced.
In your case since you want different numbers of observations to
contribute to each mean you will need a different approach:
Maybe this is helpful.
Install ggplot2.
#Create a small example
x - seq(1:20)
y - (2*x) + rnorm(length(x),0,1)
id - rep(1:5,each=4)
dat - data.frame(x,y,id)
library(ggplot2)
p - ggplot(dat,aes(x=x,y=y,colour=factor(id)))
p - p + geom_point()
p
If this is not the correct structure, maybe
On Aug 5, 2009, at 5:45 PM, Noah Silverman wrote:
In my continuing quest to generate some summary data, I've come
across some useful suggestions in pasts posts.
The apply operation returns an error, and I can't figure out why.
Can someone help me fix this?
testlogdata - cbind(testlogdata,
Hi,
On Aug 5, 2009, at 5:55 PM, Ivo Shterev wrote:
I have a question related to scoping. Suppose we have 2 functions:
f1 = function(i){i = 1}
f2 = function(n){
i = length(n)
f1(i)
}
In other words, I would like i=1 regardless of n. Is this possible
without having f1 in the body of f2?
Try this:
library(zoo)
# ignore the fact that months have different lengths
z - with(airquality, zoo(cbind(Wind, Temp), Month + (Day - 1)/31))
plot(z) # each on separate plot stacked above each other
plot(z, screen = 1) # both on same plot
library(lattice)
xyplot(z)
xyplot(z, screen = 1)
Hi -
I'm trying to use R to create an MS Access query object. In particular, I
would like to pass a given sql statement to a variety of Access files and
have that sql statement saved as an Access Query in each db. Is this
possible using R?
I'm aware that I could use RODBC sqlQuery and write sql
Is there a simple way to specify a theme or trellis (lattice) parameters so
that, in a multipanel (conditioned) plot, there is no color and in the
strips there is no shading? This is the effect achieved on page 124 of
Deepayan Sarkar's Lattice (figure 7.2).
I managed to trick lattice into making a
On Wed, Aug 5, 2009 at 2:24 PM, Jacob Wegelinjacob.wege...@gmail.com wrote:
On Wed, 5 Aug 2009, Deepayan Sarkar wrote:
On 8/5/09, Jacob Wegelin jacob.wege...@gmail.com wrote:
I would like to use lattice graphics to plot multiple functions (or
groups
or subpopulations) on the same plot
On Wed, Aug 5, 2009 at 6:27 PM, Jacob Wegelinjacob.wege...@gmail.com wrote:
Is there a simple way to specify a theme or trellis (lattice) parameters so
that, in a multipanel (conditioned) plot, there is no color and in the
strips there is no shading? This is the effect achieved on page 124 of
Is k the count?
What are x and y? are both measured?
Don't the two k's in the exp term cancel?
Is there a reference?
glen_b wrote:
Let me rephrase. You have some counts. You have some other measurement or
measurements. Presumably you are trying to predict (fit) expected count in
Hi,
I'm sorry i didn't say clearly.
for (i in 1:10){
+ print(sample(9,4,replace=T))
+ }
[1] 2 5 5 2
[1] 6 2 1 5
[1] 9 5 9 7
[1] 2 6 4 1
[1] 8 5 4 5
[1] 6 2 3 7
[1] 6 1 7 3
[1] 9 5 4 7
[1] 6 4 8 5
[1] 1 5 6 3
I mean when it shows these reults.
Then, what should I do to show the top
hi all,
i have a simple scatter plot, and i'd like to make it so the scatter
plot colors are slightly transparent. i see in a previous post that
someone mentioned the alpha parameter, but i am not sure how it can
be used with the 'plot' function [*].
for example, suppose i have:
Hi Gina,
On Aug 5, 2009, at 11:25 PM, Gina Liao wrote:
Hi,
I'm sorry i didn't say clearly.
for (i in 1:10){
+ print(sample(9,4,replace=T))
+ }
[1] 2 5 5 2
[1] 6 2 1 5
[1] 9 5 9 7
[1] 2 6 4 1
[1] 8 5 4 5
[1] 6 2 3 7
[1] 6 1 7 3
[1] 9 5 4 7
[1] 6 4 8 5
[1] 1 5 6 3
I mean when it
Hi,
On Aug 5, 2009, at 11:48 PM, per freem wrote:
hi all,
i have a simple scatter plot, and i'd like to make it so the scatter
plot colors are slightly transparent. i see in a previous post that
someone mentioned the alpha parameter, but i am not sure how it can
be used with the 'plot'
Lattice graphics can do that:
library(lattice)
xyplot(0:20 ~ 0:20, alpha = 0:20/20, col = red, pch = 19, cex = 5)
Google for
HTML colors
to find out more about the hex codes you are referring to.
On Wed, Aug 5, 2009 at 11:48 PM, per freemperfr...@gmail.com wrote:
hi all,
i have a simple
Hello,
in order to test the parallelism assumption of ordinal regression, would it
be appropriate to compare the likelihoods of a model fit by polr {MASS
package} with a multinomial model fit by multinom {nnet package}?
e.g.
# dataframe ologit previously read from
101 - 141 of 141 matches
Mail list logo