similar to: control of scat1d tick color in plot.Predict?

Displaying 20 results from an estimated 700 matches similar to: "control of scat1d tick color in plot.Predict?"

2005 Jun 16
1
AIC in glm.fit with intercept
Dear R users, glm.fit() gave me the same AIC's regardless of TRUE or FALSE intercept option. > myX <- as.matrix(1:10) > myY <- 3+5*myX > foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=TRUE) > foo$aic [1] 38.94657 > foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=FALSE) > foo$aic [1]
2008 Oct 29
1
How to set read.table variables to vectors?
The summary stats for the xin and yin variables below are correct. However, if I use plot(xin,yin), an exception is thrown saying that "object xin is not found." Also, it is apparent that I can't successfully replace the x and y vectors with values from xin and yin. The four plots on one panel are showing but the range of x and y is only [0,1], and therefore, it seems like an
2012 Apr 30
1
question on jitter in plot.Predict in rms
Dear colleagues, I have a question regarding controlling the jitter when plotting predictions in the rms package. Below I've simulated some data that reflect what I'm working with. The model predicts a continuous variable with an ordinal score, a two-level group, and a continuous covariate. Of primary interest is a plot of the group by score interaction, where the score is the ordinal
2006 Aug 21
4
question about 'coef' method and fitted_value calculation
Dear all, I am trying to calculate the fitted values using a ridge model (lm.ridge(), MASS library). Since the predict() does not work for lm.ridge object, I want to get the fitted_value from the coefficients information. The following are the codes I use: fit = lm.ridge(myY~myX,lambda=lamb,scales=F,coef=T) coeff = fit$coef However, it seems that "coeff" (or "fit$coef") is
2006 Jul 03
1
xlab, ylab in balloonplot(tab)?
I'm not understanding something. I'm trying to add xlab & ylab to a balloon plot of a table object. From docs I thought following should work: require(gplots) # From balloonplot example: # Create an example using table xnames <- sample( letters[1:3], 50, replace=2) ynames <- sample( 1:5, 50, replace=2) tab <- table(xnames, ynames) balloonplot(tab)
2007 Nov 15
3
Graphics device storable in a variable
I'm using R embedded in PostgreSQL (via PL/R), and would like to use it to create images. It works fine, except that I have to create every image in a file (owned by and only readable by the PostgreSQL server), and then use PostgreSQL to read from that file and return it to the client. It would be much nicer if I could plot images into an R variable (for instance, a matrix), and return that
2007 Apr 18
5
Problem with ?curve
Dear all R gurus, I have following syntax: y = c(1:10) chippy <- function(x) { y[5] = x sin(cos(t(y)%*%y)*exp(-t(y)%*%y/2)) } curve(chippy, 1, 20, n=200) But I am getting error while executing : Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ In addition: Warning message: number of items to
2005 Jul 05
1
Kind of 2 dim histogram - levelplot
Dear R-List, I've written some code to put measurement values at a position x and y in bins (xb and yb). It works, but I wonder if there isn't a function that would do what I do by hand in "# fill data in bins"? Here is the code: # data x <- c( 1.1, 1.5, 2.3, 2.5, 2.6, 2.9, 3.3, 3.5 ) y <- c( 6.3, 6.2, 5.9, 5.3, 5.4, 4.2, 4.8, 4.6 ) val <- c( 50, 58, 32, 14, 12,
2013 Nov 21
2
overlaying 2D grid on randomly distributed points
Hi, I have a cloud of randomly distributed points in 2-dimensional space and want to set up a grid, with a given grid-cell size, that minimizes the distance between my points and the grid nodes. Does anyone know of an R function or toolbox that somehow addresses this problem? This is a problem of optimizing the location of the grid, not a problem of deciding what should be the grid-cell size,
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings: I would like comments on this example and after fixing it up, I need help from someone who has access to insert this in R's help page for plotmath. I uploaded a drawing http://pj.freefaculty.org/R/Normal-2009.pdf that is created by the following code http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R This will be a good addition to the plotmath help page/example.
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2017 Jun 18
0
R_using non linear regression with constraints
> On Jun 18, 2017, at 6:24 AM, Manoranjan Muthusamy <ranjanmano167 at gmail.com> wrote: > > I am using nlsLM {minpack.lm} to find the values of parameters a and b of > function myfun which give the best fit for the data set, mydata. > > mydata=data.frame(x=c(0,5,9,13,17,20),y = c(0,11,20,29,38,45)) > > myfun=function(a,b,r,t){ > prd=a*b*(1-exp(-b*r*t)) >
2017 Jun 18
0
R_using non linear regression with constraints
I ran the following script. I satisfied the constraint by making a*b a single parameter, which isn't always possible. I also ran nlxb() from nlsr package, and this gives singular values of the Jacobian. In the unconstrained case, the svs are pretty awful, and I wouldn't trust the results as a model, though the minimum is probably OK. The constrained result has a much larger sum of squares.
2017 Jun 18
3
R_using non linear regression with constraints
https://cran.r-project.org/web/views/Optimization.html (Cran's optimization task view -- as always, you should search before posting) In general, nonlinear optimization with nonlinear constraints is hard, and the strategy used here (multiplying by a*b < 1000) may not work -- it introduces a discontinuity into the objective function, so gradient based methods may in particular be
2020 Oct 17
2
??? is to nls() as abline() is to lm() ?
I'm drawing a fitted normal distribution over a histogram. The use case is trivial (fitting normal distributions on densities) but I want to extend it to other fitting scenarios. What has stumped me so far is how to take the list that is returned by nls() and use it for curve(). I realize that I can easily do all of this with a few intermediate steps for any specific case. But I had expected
2017 Jun 18
0
R_using non linear regression with constraints
I've seen a number of problems like this over the years. The fact that the singular values of the Jacobian have a ration larger than the usual convergence tolerances can mean the codes stop well before the best fit. That is the "numerical analyst" view. David and Jeff have given geometric and statistical arguments. All views are useful, but it takes some time to sort them all out and
2020 Oct 17
0
??? is to nls() as abline() is to lm() ?
I haven't followed your example closely, but can't you use the predict() method for this? To draw a curve, the function that will be used in curve() sets up a newdata dataframe and passes it to predict(fit, newdata= ...) to get predictions at those locations. Duncan Murdoch On 17/10/2020 5:27 a.m., Boris Steipe wrote: > I'm drawing a fitted normal distribution over a
2017 Jun 18
3
R_using non linear regression with constraints
I am not as expert as John, but I thought it worth pointing out that the variable substitution technique gives up one set of constraints for another (b=0 in this case). I also find that plots help me see what is going on, so here is my reproducible example (note inclusion of library calls for completeness). Note that NONE of the optimizers mentioned so far appear to be finding the true best
2011 Aug 18
1
Where are the ticks on grid.xaxis?
Hi R list, I like the default ticks that are set up using grid.xaxis() or grid.yaxis() with no arguments. Finding good values for the 'at' argument is usually not a trivial task; the default behavior of these functions seems to work well. The problem with this strategy is that I cannot figure out how to "recover" the positions of these ticks when you do NOT specify the
2010 Jul 06
1
plotmath vector problem; full program enclosed
Here's another example of my plotmath whipping boy, the Normal distribution. A colleague asks for a Normal plotted above a series of axes that represent various other distributions (T, etc). I want to use vectors of equations in plotmath to do this, but have run into trouble. Now I've isolated the problem down to a relatively small piece of working example code (below). If you would