similar to: lattice panel.lmline problem

Displaying 20 results from an estimated 6000 matches similar to: "lattice panel.lmline problem"

2007 Sep 07
1
contourplot lines, text, and mtext
If I have a contourplot (in the lattice package) and I want to add straight lines to it, how do I do this? I see that there are llines() and lsegement() functions for lattice plots, but they don't seem to do anything in this case: library(lattice) library(KernSmooth) x=rnorm(10000) y=x+rnorm(x,0,.5) a=bkde2D(cbind(x,y),.7) z=as.vector(a$fhat) grid=expand.grid(x=a$x1,y=a$x2) grid$z=z
2007 Feb 23
2
Extracting a subset from a dataframe
Good day everyone, Can anyone suggest an effective method to solve the following problem: I have 2 dataframes D1 and D2 as follows: D1: dates ws wc pwc 2005-10-19:12:00 10.8 80 81 2005-10-20:12:00 12.3 5 15 2005-10-21:15:00 12.3 3 15 2005-10-22:15:00 11.3 13 95 2005-10-23:12:00 12.3 13 2 2005-10-24:15:00 10.3 2 95 2005-10-25:15:00 10.3 2 2 D2:
2006 Feb 21
2
indexing within panels in xyplot
Dear R-helpers, I need to show a linear fit through a subset of the data within each combination of levels of two factors. So I prepared an xyplot with different panels for each level of one of the factors, and different symbols within each panel for the levels of the second factor. My problem is selecting the subset of each combination through which the line should be fit for subsequent
2007 Oct 24
2
analytical solution to Sum of binominal distributed random numbers?
Frede Aakmann T?gersen wrote: > Perhaps > > http://stinet.dtic.mil/cgi-bin/GetTRDoc?AD=ADA266969&Location=U2&doc=GetTRDoc.pdf > > is something that you can use? Thanks a lot - that might help. Rainer > > > > Best regards > > Frede Aakmann T?gersen > Scientist > > > UNIVERSITY OF AARHUS > Faculty of Agricultural Sciences > Dept.
2007 Jul 05
1
getting values from arrays using which()
Dear R-Help, I have an array 1260x1260, upper triangle consisting of numbers between 0 and 100, and lower triangle all NA. I can extract the index of those values say above 99 using the following code: which(myArray>=99 , ind.arr=T) which returns: row col 5475 252 253 45423 764 765 46902 777 778 34146 611 962 50681 1220 1221 Now I would like to if poss print the actual value
2007 Aug 04
2
Problems using "lm" in combination with "predict"
Hello everybody, I'm trying to predict a linear regression model but it does not work. My Model: y = Worktime + Vacation + Illnes + Bankholidays My modelmatrix is of dimension 28x4 Then I want to make use of the function predict because there confidence.intervals are include. My idea was: mod <- lm(y~Worktime+Vacation+Illnes+Bankholidays) newdate=data.frame(x=c(324,123,0.9,0.1))
2008 Feb 15
1
How to estimate the parameters of differential equations from data
Hello list I have a theoretical differential equation model (two coupled differential equations) describing the acidification of dairy cultures in milk: dX/dt = f(H, param)*X dH/dt = g(param)*dX/dt pH = -log10(H) I also have actual data of the same. I would like to estimate the parameters of the theoretical model from real data, but don't know how to go about it in R (I'm fairly new
2007 Nov 12
2
how to randomize a vector
I have a vector whose length is nearly 70 thousand. I need randomize it for 1000 times . for randomizing , I mean ,the elements of the vector remain intact while their order in the vector get changed randomly. I have written a function which seems to be able to solve short vectors , but waste a lot of time when dealing with the the long vector mentioned above. -- View this message in context:
2007 Aug 07
2
R and excell differences in calculation F distributionfunction
R-help, I'm trying to work out the density function by doing: > df(5.22245, 3, 22) [1] 0.005896862 > df(15.20675, 6, 4) [1] 0.001223825 In excell the result is : 0.0071060464 <*> FDIST(5.22245,3,22) 0.0100001406 <--> FDIST(15.20675,6,4) >From my point of view the differences in the second case are substantial. Can anyone give me a hint on this? Thanks in
2007 Nov 11
4
Largest N Values Efficiently?
What is the most efficient alternative to x[order(x)][1:n] where length(x)>>n? I also need the positions of the mins/maxs perhaps by preserving names. Thanks for any suggestions. -- View this message in context: http://www.nabble.com/Largest-N-Values-Efficiently--tf4788033.html#a13697535 Sent from the R help mailing list archive at Nabble.com.
2007 Aug 23
1
nls() and numerical integration (e.g. integrate()) working together?
Dear List-Members, since 3 weeks I have been heavily working on reproducing the results of an economic paper. The method there uses the numerical solution of an integral within nonlinear least squares. Within the integrand there is also some parameter to estimate. Is that in the end possible to implement in R [Originally it was done in GAUSS]? I'm nearly into giving up. I constucted an
2007 Oct 29
1
meaning of lenwrk value in adapt function
R-listers, In using the adapt function, I am getting the following warning: Ifail=2, lenwrk was too small. -- fix adapt() ! Check the returned relerr! in: adapt(ndim = 2, lower = lower.limit, upper = upper.limit, functn = pr.set, Would someone explain what the 'lenwrk' value indicates in order to help diagnose this issue. Also, what are the possible codes for Ifail, so I can set
2007 Nov 27
4
if condition and for cycles
I have two questions about R: 1) Does anyone knows why I get the plots but not the summary results of the linear fitting when I run this code? When I run it outside the if condition it works fine. if (op==4) { t=1:length(time(SeaIce)) fitlinear=lm(SeaIce~t) windows() plot.ts(SeaIce) lines(ts(fitlinear$fitted.values,start=1979,frequency=12)) summary(fitlinear)
2009 Jan 23
1
lattice: reverse order of panel.lmline, panel.smooth
Hi, is it possible to reverse the order in which panel.lmline() or panel.smooth() operation in xyplot() ? This type of situation might occur when plotting some variable with depth, but the relation we want to describe is variable ~ depth, and not depth ~ variable, as the plotting formula would suggest. # an example: d <- 1:100 v <- d * rnorm(100) xyplot(d ~ v, ylim=c(100,0),
2012 Oct 30
1
Is there an lm() equivalent of panel.lmline()?
panel.lmline returns intercept and slope of y ~ x subsetted to the combination of conditioning factors given to xyplot in lattice. for instance: xyplot(Xvalues ~ log(Qvalues)|Tfac, data = df7, panel = panel.lmline) I am looking to find the equivalent formulation for lm() proper. If I do this: lmcal <- lm(Xvalues ~ log(Qvalues):Tfac, data = df7) Only one value of the intercept is returned.
2004 Sep 17
2
lattice: bwplot and panel.lmline()
On Friday 17 September 2004 13:52, RenE J.V. Bertin wrote: > Hello again, > > I am doing regressions (using panel.lmline() (and panel.abline( > rlm(...))) ) inside a panel method which I pass to bwplot(). > > What I would like to do is create a boxplot of categorised data > (binned on the independent variable), and superpose a regression line > which is calculated using the
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community: I tried both of these three versions with ylim as suggested, none work: I am getting only single (pch = 16) not overlayed (pch =3) everytime. *vs 1* require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) panel.lmline(x, y, lty=4, col =
2011 Sep 09
1
Adding groups to regression line panel function in Lattice
I wish to display a single-panel Lattice figure with grouped data and fitted regression lines. I don't seem to be able to get the individual regression lines to display, e.g.; d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6)) # create data frame with group identifier 'q', independent variable cc d$ba = d$q*0.1*d$cc + 5*rnorm(nrow(d))
2005 Feb 10
1
xyplot() question
Dear R Users, I have an xyplot() where different plotting symbols are used for subgroups (originally used within S-Plus, but hopefully it?s also applicable to R users). How can I fit separate regression lines for every subgroup? So far, I can only plot the overall fitted line. The code looks like this: trellis.device() sps<-trellis.par.get("superpose.symbol") sps$pch<-1:7
2007 Jul 20
3
binned column in a data.frame
Dear all, I would like to know how can I create a binned column in a data.frame. The output that I would like is something like this: Start Binned_Start 1 0-5 2 0-5 6 5-10 8 5-10 13 10-15 ... Best regards João Fadista Ph.d. student UNIVERSITY OF AARHUS Faculty of Agricultural Sciences Dept. of Genetics and Biotechnology Blichers