Displaying 20 results from an estimated 11000 matches similar to: "error propagation - hope it is correct subject"
2018 Feb 12
3
plotting the regression coefficients
Hi
After melt you can change levels of your factor variable. Again with the toy example.
> levels(temp$variable)
[1] "y1" "y2" "y3" "y4"
> levels(temp$variable) <- levels(temp$variable)[c(2,4,1,3)]
> levels(temp$variable)
[1] "y2" "y4" "y1" "y3"
>
And you will get graphs with this new levels ordering.
2011 Jun 07
2
gam() (in mgcv) with multiple interactions
Hi! I'm learning mgcv, and reading Simon Wood's book on GAMs, as recommended to me earlier by some folks on this list. I've run into a question to which I can't find the answer in his book, so I'm hoping somebody here knows.
My outcome variable is binary, so I'm doing a binomial fit with gam(). I have five independent variables, all continuous, all uniformly
2018 Feb 12
0
plotting the regression coefficients
Petr, there was a thinko in your response.
tmp <- data.frame(m=factor(letters[1:4]), n=1:4)
tmp
tmp$m <- factor(tmp$m, levels=c("c","b","a","d")) ## right
tmp[order(tmp$m),]
tmp <- data.frame(m=factor(letters[1:4]), n=1:4)
levels(tmp$m) <- c("c","b","a","d") ## wrong
tmp[order(tmp$m),]
changing levels
2012 Aug 29
4
Sorting of columns of a matrix
Dear all,
Please suggest me how can I do it.
I have a matrix which look like following:
x1 x2 x3 t1 .01 0.3 0 t2 0 0.1 0.01 t3 0 .01 .01 t4 0 0 t5 5 0 0 t6
0 0 0 t7 0 0 0 t8 0 0 0 t9 0.6 0 0 t10 0 0 0.66 t11 0 0.6 0.11 t12 0
0.4 0
I want to sort decreasing order in each column based on rows. and then to
display only those rows which has a value. The expected out put matrix will
2018 Feb 12
2
plotting the regression coefficients
Hi Petr and Richard;
Thanks for your responses and supports. I just faced a different problem.
I have the following R codes and work well.
p <- ggplot(a, aes(x=Phenotypes, y=Metabolites, size=abs(Beta),
colour=factor(sign(Beta)))) +
theme(axis.text=element_text(size = 5))
p1<-p+geom_point()
p2<-p1+theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
2010 Feb 04
3
strange behaviour of median
During some experimentation in preparing R lessons I encountered this
behaviour which I can not explain fully
mat <- matrix(1:16, 4,4)
df1 <- data.frame(mat)
> mean(df1)
X1 X2 X3 X4
2.5 6.5 10.5 14.5
Expected, documented
> median(df1)
[1] 6.5 10.5
Rather weird, AFAIK there shall not be an issue with data frame at least I
did not find any in help page. I tracked it
2006 May 19
5
Converting character strings to numeric
I assume that I have missed something fundamental and that it is there in front of me in "An Introduction to R", but I need someone to point me in the right direction.
> x1 <- "1159 1129 1124 -5 -0.44 -1.52"
> x2 <- c("1159","1129","1124","-5","-0.44","-1.52")
> x3 <- unlist(strsplit(x1,"
2018 Feb 13
0
plotting the regression coefficients
Hi
scale_colour_gradient(?red?, ?blue?)
should do the trick.
Actually I found it by Google
ggplot colour
http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/
http://www.sthda.com/english/wiki/ggplot2-colors-how-to-change-colors-automatically-and-manually#gradient-colors-for-scatter-plots
question. So you could find it too and probably far more quickly then myself as I have also other duties.
Cheers
2018 Feb 12
2
plotting the regression coefficients
Hi
Maybe there are other ways but I would split data to several chunks e.g. in list and use for cycle to fill multipage pdf.
With the toy data something like
library(reshape2)
library(ggplot2)
temp <- melt(temp)
temp.s<-split(temp, cut(1:nrow(temp), 2))
pdf("temp.pdf")
for (i in 1: length(temp.s)) {
p <- ggplot(temp.s[[i]], aes(x=par1, y=variable, size=abs(value),
2018 Feb 08
2
plotting the regression coefficients
Hi Petr;
Thanks for your reply. It is much appreciated. A small example is given
below for 4 independent and 4 dependent variables only. The values given
are regression coefficients.I have looked ggplot documents before writing
to you. Unfortunately, I could not figure out as my experience in ggplot is
ignorable
Regards.
Greg
y1 y2 y3 y4
x1 -0.19 0.40 -0.06 0.13
x2 0.45 -0.75 -8.67 -0.46
x3
2006 Oct 15
1
how can i compute the average of three blocks for each column ?
Dear all,
I want to compute the average of the three blocks for each x-variable which is equal slide in the code below. How can I do that ?
block x1 x2 x3 x4 x5
1 23 22 23 24 23
1 21 25 26 21 39
1 23 24 22 23 23
2 20 21 23 24 28
2 32 23 34 24 26
2 19
2018 Feb 08
2
plotting the regression coefficients
Hi Petr;
Thanks so much. Exactly this is what I need. I will play to change color
and so on but this backbound is perfect to me. I do appreciate your help
and support.
Regards,
Greg
On Thu, Feb 8, 2018 at 1:29 PM, PIKAL Petr <petr.pikal at precheza.cz> wrote:
> Hi
>
> I copied your values to R, here it is
>
>
>
> > dput(temp)
>
>
>
> temp <-
2018 Feb 12
0
plotting the regression coefficients
Hi Petr;
Thanks so much. This is great! Although last Sunday, alternatively, I have
solved the problem using the following statement at the very end of the
program.
* ggsave('circle.pdf', p4, height = 70, width = 8, device=pdf, limitsize =
F, dpi=300).*
This works very well too.
Asa my categorical variables are in my Y axis, my R program reorders the
names on Y-axis. However, I would
2015 Jan 15
1
Closing over Garbage
Given a large data.frame, a function trains a series of models by looping over two steps:
1. Create a model-specific subset of the complete training data
2. Train a model on the subset data
The function returns a list of trained models which are later used for prediction on test data.
Due to how models and closures work in R, each model contains a lot of data that is not necessary for
2003 Dec 19
2
[Mailman] question: contour plot for discrete data
Question:
I have matrix (n x3) that represents discrete data.
Each row of matrix is 3-D point (x,y,z). I would like
to get contour map (z value) at two dimension
(x,y). How can I use related contour function to do
this job?
I am not sure if I clarify this question. For example,
we can get point (x,y)
at 2 dimension according to first two columns of
matrix. Then I want to connect
same value
2018 Feb 10
0
plotting the regression coefficients
Hi Peter;
The R code you provided works very well. Once again thanks so much for
this. The number of variables in my data set that should appear on the
y-axis is 733 and they are not numerical (for example the name of one
variable is *palmitoyl-arachidonoyl-glycerol (16:0/20:4) [1]**. So, the
plot looks very messy in one page. How can I make the plot to print out on
multiple pages?
Regards,
2018 Feb 08
0
plotting the regression coefficients
Hi
I copied your values to R, here it is
> dput(temp)
temp <- structure(list(par1 = structure(1:4, .Label = c("x1", "x2", "x3",
"x4"), class = "factor"), y1 = c(-0.19, 0.45, -0.09, -0.16),
y2 = c(0.4, -0.75, 0.14, -0.01), y3 = c(-0.06, -8.67, 1.42,
2.21), y4 = c(0.13, -0.46, 0.06, 0.06)), .Names = c("par1",
"y1",
2009 Aug 20
1
how to compute this summation...
Dear R users,
I try to compute this summation,
http://www.nabble.com/file/p25054272/dd.jpg
where
f(y|x) = Negative Binomial(y, mu=exp(x' beta), size=1/alp)
http://www.nabble.com/file/p25054272/aa.jpg
http://www.nabble.com/file/p25054272/cc.jpg
In fact, I tried to use "do.call" function to compute each u(y,x) before the
summation, but I got an error, "Error in X[i, ]
2004 Nov 30
3
2k-factorial design with 10 parameters
Hi,
I'd like to apply a 2^k factorial design with k=10 parameters. Obviously
this results in a quite long term for the model equation due to the high
number of combinations of parameters.
How can I specify the equation for the linear model (lm) without writing
all combinations explicitly down by hand? Does a R command exist for
this problematic?
Thanks for your help in advance,
Sven
2004 Nov 16
1
Pairwise Distances -- How to vectorize the loop
R-List,
I'm trying to compute pairwise distances among pairs of observations,
which each pair containing data from 2 groups. There are more than
100000 unique pairs. I have programmed a distance function that has
three parameters, a vector of covariates from the ith observation in
Group 1, a vector of covarites from the jth observation in Group 2, and
a weighting matrix.
I have used