Displaying 20 results from an estimated 400 matches similar to: "using color palette in persp"
2010 Jul 29
1
3d data plot
Hello!
I'm a newbe, and a bit confused amongst the data types and functions...
The problem to be solved is the following: We have measurements. They are in
a csv file, in 3 columns. So this would be an x-y-z plot, where z is the
measurement at (x,y) conditions. Just a simple plot, nothing special. Dots,
surface columns - doesn't matter to me. I just can't figure it out somehow.
2011 Aug 12
1
Which Durbin-Watson is correct? (weights involved) - using durbinWatsonTest and dwtest (packages car and lmtest)
Hello!
I have a data frame mysample (sorry for a long way of creating it
below - but I need it in this form, and it works). I regress Y onto X1
through X11 - first without weights, then with weights:
regtest1<-lm(Y~., data=mysample[-13]))
regtest2<-lm(Y~., data=mysample[-13]),weights=mysample$weight)
summary(regtest1)
summary(regtest2)
Then I calculate Durbin-Watson for both regressions
2017 Aug 19
0
My very first loop!! I failed. May I have some start-up aid?
Thank you for providing the example code... for the request of running it
multiple times it would have helped if you could have confirmed that the
example ran through without errors... there were a lot of mistakes in it.
Look into using the reprex package to check your example next time.
I don't do this kind of analysis... I really don't know what to expect
from the functions. The
2017 Aug 19
0
My very first loop!! I failed. May I have some start-up aid?
[answers inline]
On 18 August 2017 at 20:08, Dagmar <Ramgad82 at gmx.net> wrote:
>
> myframe<- data.frame (ID=c("Ernie", "Ernie","Ernie","Ernie"),
> Timestamp=c("24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00",
> "25.09.2012 10:00"),
2017 Aug 19
4
My very first loop!! I failed. May I have some start-up aid?
Dear all,
I have a data similar to this:
myframe<- data.frame (ID=c("Ernie", "Ernie","Ernie","Ernie"),
Timestamp=c("24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00",
"25.09.2012 10:00"), Longitude=c("8.481","8.482","8.483","8.481"),
2012 Jun 14
1
Question about sampling
Dear list I wish to extract from a population genotypized for 10 SNP a
subsample of the same population of size n with similar allele frequencies.
Essentially i have a matrix of 200 rows (df) like this
Name,Condition,rs1385699_X,rs6625163_X,rs962458_X,Rs4658627_1,
sample01,Case,1,1,1,-1
sample02,Control,1,1,1,1
sample06,Control,1,-1,1,0
sample10,Case,1,1,1,0
sample11,Control,1,1,1,1
2009 Dec 21
3
Question About Repeat Random Sampling from a Data Frame
Good Morning:
I've read many, many posts on the r-help system and I feel compelled to quickly admit that I am relatively new to R, I do have several reference books around me, but I cannot count myself among the fortunate who seem to strong programming intuition.
I have a data set consisting of 1637 observations of five variables: tensile strength, yield strength, elongation, hardness and a
2011 Apr 08
3
random sampling with levels and with replacement
Dear all,
i have a dataset of about 400 records , with a variable that has two levels 40 bad and 360 good among other variables,how do i come up with10 random samples that have the composition of as the main sample but maintaining the 40 bad 360 good with replacement, i recently discovered that my random samples generated dont maintain the ratio. My code is as :
mysample <-
2012 Mar 07
5
Sampling problems
Hi,
I need to sample randomly my dataset for 1000 times. The sample need to be
the 80%. I know how to do that, my problem is that not only I need the 80%,
but I also need the corresponding 20% each time. Is there any way to do
that?
Alternatively, I was thinking to something like setdiff () function to
compare my 80% sample to the original dataset and obtain the corresponding
20%, unfortunately
2009 Aug 20
2
boxplot with log="y" and values starting at 0
Hi,
I'm working with a data.frame containing values between 0 and 22000.
Most of the values are actually between 0 and 50 and the high ones are
outliers.
I want to generate a boxplot and since the outliers are extremely
high, I need to scale the y scale logarithmically. Otherwise one
wouldn't really see the boxes of the boxplot.
boxplot(dat, log="y", ylim=c(0,
2009 Nov 13
2
help sample from large dataset - misleading error?
Hi All,
I want to take a simple random sample from a large dataset, gly, but I'm
getting an error message. Any help?
dim(gly)
[1] 112371 37
> s1 <- sample(gly,100)
Error in `[.data.frame`(x, .Internal(sample(length(x), size, replace, :
cannot take a sample larger than the population when 'replace = FALSE'
Thanks,
Rachel
[[alternative HTML version
2003 Jun 18
2
Private: Problem with tapply/lapply and sample (PR#3286)
Full_Name: Peter Gedeck
Version: R1.6.2 and R1.7.0
OS: Windows XP
Submission from: (NULL) (194.191.169.72)
Hello,
I marked the bug report Private, as I don't want my email address on the web
server. The problem that I found is best explained using an example.
index <- 1:6
cluster <- c(1,1,1,2,2,3)
tapply(index,cluster,sample)
gives
$"1"
[1] 2 1 3
$"2"
[1] 4 5
2009 May 21
3
Problems with sample variance
Dear R users,
I am a beginner to R. I generated 1000 samples with 15 data in each sample
I tried finding the variance for each sample
I used the code:
m=1000;n=15
> r<-rnorm(15000)
> for(i in 1:m){
x=data[,i]
v=var(x)}
what I got was just the variance for the last sample i.e. the 1000th sample
but what I want is 1000 variance.
Does anyone know what I did wrong?
Thanks
Chloe Smith
2012 May 08
1
revolution foreach oddity
I know this is not a revolution support forum, but as anyone noticed the
following?
I have a foreach loop to generate random samples. If I run the exact code
below in normal r (2.14.1) it works as expected, but if I run it from
revolution 4.2.0 each loop returns the same numbers.
The only way I can get revolution to give different numbers is using 1
instead of 8 in
registerDoSNOW(makeCluster(8,
2010 Aug 11
1
non-linear regression for 3D data
Hello!
Is there a simplier way in R to get a nonlinear regression (like nls) for a
surface? I have 3D data, and it is definitely not a linear surface with
which it would fit the best. Rather sg like z = a + f(x) + g(y) where
probably both f and g are polinomes (hopefully quadratic).
Szilvia
--
View this message in context:
2007 Feb 27
3
looping
Greetings:
I am looking for some help (probably really basic) with looping. What I want
to do is repeatedly sample observations (about 100 per sample) from a large
dataset (100,000 observations). I would like the samples labelled sample.1,
sample.2, and so on (or some other suitably simple naming scheme). To do
this manually I would
>smp.1 <- sample(100000, 100)
>sample.1 <-
2005 Feb 28
1
draw random samples from empirical distribution
Dear useRs,
I have an empirical distribution (not normal etc) and I want to draw
random samples from it. One solution I can think of is to compute let's
say 100 quantiles, then use runif() to draw a random number Q between 1
and 100, and finally run runif() again to pull a random value from the
quantile Q. Is there perhaps a better/more elegant way of doing this?
Thank you,
b.
2010 Jul 12
1
long to wide on larger data set
I have a data set that has 4 columns and 53860858 rows. I was able to
read this into R with:
cc <- rep("character",4)
myData <- read.table("myData.csv",header=FALSE,skip=1,colClasses=cc,nrow=53860858,sep=",")
I need to reshape this data from long to wide. On a small data set the
following lines work. But on the real data set, it didn't finish even
when I
2007 Oct 10
3
simulated data using empirical distribution
Hello all:
I'm sure this is a trivial request, but I'm still a beginner at this,
and haven't been able to find it. I need to create simulated data based
on some empirical distributions of a single variable. I've found R
functions to help me simulate data based on analytical distributions, or
to make simulations based on correlation matrices, but nothing so simple
as what I need.
2001 Dec 13
2
sample (PR#1212)
Full_Name: Antonio Possolo
Version: 1.3.1
OS: Linux (RH 7.1), Windows 2000
Submission from: (NULL) (192.35.44.3)
A FEATURE THAT EASILY GENERATES BUGS
sample(pi, size=1) produces 1, 2, or 3.
sample(c(pi, pi), size=1) produces 3.141593 always.
Although this conforms with the behavior explained in the help page for
"sample",
the behavior for the case where x (in sample(x, ...)) has