similar to: linear regression of data with standard deviation

Displaying 20 results from an estimated 10000 matches similar to: "linear regression of data with standard deviation"

2004 Feb 21
3
saving variables created by functions in the workspace
Hello , just a simple question from a beginner: I write the function: plotsinx <- function() { x<-seq(0,2*pi,0.01) sinx<-sin(x) plot(sinx) } I recall it: plotsinx() and the plot works properly. but then in the workspace if I want to look at the values of sinx the following error is displayed: Error: Object "sinx" not found. How to save the variables created by the function on
2004 Mar 08
2
getting the std errors in the lm function
Hello, I have a simple question for you: making: mylm<-lm(y~x) summary(mylm) I get the following results: ****************************************************** Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.54087 0.19952 82.91 <2e-16 *** x[1:19] -2.32337 0.04251 -54.66 <2e-16 *** ******************************************************
2004 Feb 23
2
deleting elements from an array/object
Hello, I created a simple histogram with: myHist<-hist(myData) the object myHist now has two arrays (among the others): myHist$mids myHist$counts Since myHist$counts contains some "0", and I want to calculate the linear fit among myHist$mids and log(myHist$counts), I want remove the elements of both arrays where these "0" occurs. which are the possible solutions to
2004 Mar 03
3
plot(x,y) with errors
Dear all, I have 2 variables, x<-c(1,2,3,4,5,6,7,8,9,10) y<-c(1.3,2.5,4.6,5.3,5.9,6.7,7.4,8.5,9.4,10.4) each point of the y variable has an error: erry<-(0.2,0.3,0.2,0.1,0.4,0.2,0.3,0.4,0.3,0.2) how to plot(x,y) with the errors segments? Thank you, Copex --------------------------------- [[alternative HTML version deleted]]
2004 Feb 28
1
Basic general statistical problem.
Hello everyone, I'd like to have suggestions about a common basic statistical approach, hope to be useful also for other R beginners. When you first get some data (i.e length of river) you may want to look at its distribution. Then you probably want to find which law follows this distribution, and to test the goodness of the fit. For doing this simple analysis I am writing some code
2007 Jul 19
2
linear interpolation of multiple random time series
Hi all, Looking for tips on how I might more optimally solve this. I have time series data (samples from a force sensor) that are not guaranteed to be sampled at the same time values across trials. ex. trial time x 1 1 1 1 5 4 1 7 9 1 12 20 2 1 0 2 3 5 2 9 10 2 13 14 2 19 22 2 24 32 Within each trial I'd like to use linear interpolation between each successive time sample to fill in
2008 Apr 11
2
How to fill out some columns?
Dear R users, I'm working with 2 data sets which look like (for example) dx and dy in the next code: # Seed set.seed(4) # First data frame dx=matrix(rnorm(6*5),ncol=6) colnames(dx)=LETTERS[1:6] # Second data frame dy=matrix(rnorm(3*5),ncol=3) colnames(dy)=c('A','C','E') As you will notice, some columns in both data sets have the same names. At the end, what I need
2011 Aug 11
1
Splitting data
I want to implement the following algorithm in R: I want to split my data, use a t test to compare both means of the groups to see if they significantly differ from each other. If this is a yes (p < alpha) I want to split again (into 4 groups) and do the same procedure twice, and stop otherwise (here the problem arises). As a final result I would have different groups of data. I made some
2002 Mar 21
1
legend - bug with argument angle (PR#1404)
When legend() is used with the angle argument as follows, not only the boxes beside the legend text, but also the whole legend box is filled with shading lines. I think this is not intended: plot(1:10) legend(8, 4, c("A", "B"), angle=c(10, 80), fill=NULL, density=20) I'd suggest as a fix (legend.R of R-1.5.0): 25c25 < rect2 <- function(left, top, dx, dy,
2005 Dec 08
1
kronecker(... , make.dimnames=TRUE)
Hi I'm using kronecker() with a matrix and a vector. I'm interested in the column names that kronecker() returns: > a <- matrix(1:9,3,3) > rownames(a) <- letters[1:3] > colnames(a) <- LETTERS[1:3] > b <- c(x=1,y=2) > kronecker(a,b,make.dimnames=TRUE) A: B: C: a:x 1 4 7 a:y 2 8 14 b:x 2 5 8 b:y 4 10 16 c:x 3 6 9 c:y 6 12 18 > The
2012 Oct 10
3
Generating random geographical coordinates
Dear all, I have two coordinates vectors, say X and Y of length n. I want to generate for each couple of coordinates X1,Y1 X2,Y2 X3,Y3....Xn,Yn a random coordinate which is located in a square define as X +/- dx and Y +/- dy. I saw the runif function which can generate for just one value at a time what I want : runif(1, X - dx, X + dx) for X and runif(1, Y - dy, Y + dy) for Y. I would like
2012 Nov 27
2
in par(mfrow=c(1, 2)), how to keep one half plot static and the other half changing
Hi, I'm trying to plot something in the following way and would like if you could help: I'd like in a same plot window, two plots are shown, the left one is a bird-view plot of the whole data, the right half keep changing, i.e., different plots will be shown up on request, so that when I select/click on some where in the left plot, the right plot will be the corresponding plot. What I
2008 Feb 28
3
Collapse an array
Suppose I have a 4-D array X with dimensions (dx, dy, dz, dp). I want to collapse the first 3 dimensions of X to make a 2-D array Y with dimensions (dx*dy*dz, dp). Instead of awkward looping, what is a good way to do this? Is there a similar function like reshape in Matlab? Thanks, Gang
2012 Jul 29
1
Return od functions
Hi! I have some questions about R function. I try to write a function for multi-returns. The function code is as attachment. dgp.par<-function(ai, bi, t, n) { t0<-t+20 y0<-matrix(0, nr=t0, nc=n) y0[1,]<-ai/(1-bi) for(tt in 2:t0) { y0[tt,]<-ai+bi*y0[tt-1,]+rnorm(n, 0, 1) } y<-y0[21:t0,] x<-y0[20:t0-1,] z<-y0[19:t0-2,] z<-z[2:t,] dy<-y[2:t,]-y[1:t-1,]
2000 Oct 06
4
R: plotting values on graphics
Everyone, I have an array of integer values which are located on a uniform 2-D grid. I want to plot the integer values at the node locations. The closest I have come is with the following code: for (i in 1:ny) { for (j in 1:nx) { ncell <- nx*(i - 1) + j ch <- as.character(ncount[ncell]) tx <- j*dx - dx/2 ty <- ny*dy - (i-1)*dy - dy/2 points(tx, ty, pch = ch, col =
2010 Jul 19
5
par("uin") ?
I inherited a function written either for an older version of R or SPlus to draw a brace, "{", in a graph. It uses par("uin") to determine the scaling of the quarter circles that make up segments of the brace, but that setting doesn't exist in current R. I'm guessing that, in the function below, ux, uy can be defined from par("usr") and
2004 Sep 28
1
call R scripts from python
Hello, I have just learnt some python, and would like to call R scripts from python, without using batch mode. I learnt how to do it from perl, in fact reading in the mail archive I found the following good example: *************************************** #!/usr/local/bin/perl open (FILE, ">test.txt"); print FILE "a,b,c,d,e\n1,2,3,4,5"; close FILE; ####### Start R
2005 Dec 29
1
use of tapply?
I'm still learning how to program with R and I was hoping someone could take the time to show me how I can rewrite this code? Many thanks Tom data.intersects<-data.frame( x=c(0.230,0.411,0.477,0.241,0.552,0.230), y=c(0.119,0.515,0.261,0.431,0.304,0.389), angle=vector(length=6), length=vector(length=6),
2008 Dec 16
0
[LLVMdev] Another compiler shootout
On Tuesday 16 December 2008 01:03:36 Evan Cheng wrote: > FYI. http://leonardo-m.livejournal.com/73732.html > > If anyone is motivated, please file bugs for the losing cases. Also, > it might make sense to incorporate the tests into our nightly tester > test suite. FWIW, I just ported my ray tracer benchmark to C and found that llvm-gcc gives much worse performance than gcc on x86
2009 Jun 06
1
large numbers of observations using ME() of spdep
Dear All, We aim to remove the spatial structure of our data using Moran Eigen Vectors and spdep package . Our data has 3694 samples and 13 variables. The computer stop working after almost 4 days of processing (we found it emitting a sharp sound and with all colors on the screen. No wories, it was restared without problem!). And we are left with nothing: no result file was produced since the