Hello everyone,
I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want
to do a constrained regression such that a0 and (1-a) 0
for the model:
Y = a*X1 + (1-a)*X2
I tried the help on the constrained regression in R but I concede that it
was not helpful.
Any help is greatly
Dear R users
I would like to group my barplot graph (see example on the R help
link). The proposed R code, adding individual bars to the plot, looks
really overwhelming. My specific dataset just consists of five groups
and three different levels within each groups (the individual bars).
I haven't been able to fully make sense of the conflicting online information
about whether and how to specify nesting structure for a nested, mixed
model. I'll describe my experiment and hopefully somebody who knows lme4
well can help.
We're measuring the fluorescence intensity of brain slices
Hi guys,
I used the following R code to generate one plot
library(lattice)
xyplot(Y~X1|as.factor(X2)*as.factor(X3), groups = as.factor(X4),
data=mydata)
Both X2 and X3 have three values. X4 has two values. I got 3x3 grids and in
each grid there are two curves about y~x1 for the two X4 values. I
I am trying to figure out why 'biglm' can handle large data set...
According to the R document - biglm creates a linear model object that uses
only p^2 memory for p variables. It can be updated with more data using
update. This allows linear regression on data sets larger than memory.
After
A working minimal example would have been better, see FAQ.
But I think you are looking for the following:
X2 - factor(c(m=2, m=5, m=10), levels=c(m=2, m=5, m=10))
Here levels are ordered in your way. There might be other solutions for
this ordering problem.
Hope it helps,
Rainer
On
Hi Dennis,
Thank you for your extensive explanations. Yes, I guess I did not explain what
I would like to do.
Basically I would like to conduct a linear regression for each of 15 classes.
Your answers gave me new
Perspective on how R works.
Thanks again for the help,
m
From:
On 31.10.2010 05:22, Neyra Peña wrote:
Hi, I'd like to unsubscribe from the list.
Thanks
Neyra
Have you ever read the first lines (those I still cite below) of the
message you got that already tells you how to unsubscribe?
Uwe Ligges
De:
Dear Group, any idea how I can download the source code for all packages in
Windows 7?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and
Ulrich wrote:
Hi,
is it possible to easily change the return value for the grep function
for cases where there is no match, for example the value 0 or No
instead of integer (0) )?
It sounds like you might want grepl (which returns a vector of TRUE and
FALSE values) rather than grep
Many thanks for the feedback the mailing list reference - will do
Obviously I am feeling very stupid now, not sure I missed that =0
sorry for that silly question
Rgds,
Julien
On Oct 30, 2010, at 8:56 PM, RICHARD M. HEIBERGER wrote:
Look at the macro
RInterface.PutArrayFromVBA
documented
Thanks for the suggestions.
I add some more detail to clarify:
h=matrix(nrow=1,ncol=22)
In my data h is:
(0.25 0.25 0 0 0 0 -0.25 -0.25 -0.25 -0.25 -0.5 -0.5 0 0.25 0.25
0.25 0.25 0.25 0.25 0.25 0.25 0.25)
xx-seq(0,1,0.5)
v=matrix(nrow=20001,ncol=22)
On 2010-10-31 01:19, Rainer Hurling wrote:
A working minimal example would have been better, see FAQ.
But I think you are looking for the following:
X2- factor(c(m=2, m=5, m=10), levels=c(m=2, m=5, m=10))
Here levels are ordered in your way. There might be other solutions for
this ordering
What is the stochastic mechanism that generates the data? In other words, what
distribution is Y, conditioned on X1 and X2, supposed to be?
You can also get `a' if you do not wanrt to specify the probability mechanism
by just doing a least squares fitting, but then making inferences can be a
Dear all,
I would like to randomly split a sample in two equally large
subsamples. The sample data is stored as a matrix with each row
representing an individual and each column representing some variable
(e.g., name, age, sex, etc.); the first row contains the names of the
variables; the first
Suppose df is a dataframe with one named row of numeric observations. I want
to coerce df into a named vector.
as.vector does not work as I expected: as.vector(df) returns the original
dataframe, while as.vector(df,mode=numeric) returns an unnamed vector of
NAs.
This works:
v -
On Oct 31, 2010, at 2:44 AM, Jim Silverton wrote:
Hello everyone,
I have 3 variables Y, X1 and X2. Each variables lies between 0 and
1. I want
to do a constrained regression such that a0 and (1-a) 0
for the model:
Y = a*X1 + (1-a)*X2
It would not accomplish the constraint that a 0 but
Hi,
I think you want ?unlist
d = data.frame(x=1, y=2, z=3)
v = unlist(d)
is(v)
[1] numeric vector
HTH,
baptiste
On 31 October 2010 16:54, James Hirschorn james.hirsch...@hotmail.com wrote:
Suppose df is a dataframe with one named row of numeric observations. I want
to coerce df into a named
On Oct 31, 2010, at 11:54 AM, James Hirschorn wrote:
Suppose df is a dataframe with one named row of numeric
observations. I want
to coerce df into a named vector.
I don't think you understand the structure of dataframes. They are
named lists of component columns. The names you are
Hi Yoan,
Please try ?sample.
Suppose you have 1:n ids of total observations where n is even, you want to
randomly split it into two subsamples, the following code should work.
n - 20
one.sample - sort(sample(1:n, n/2))
another.sample - (1:n)[-one.sample]
Good luck.
Wu
-
A R learner.
--
On Sun, Oct 31, 2010 at 2:35 AM, Carabiniero ja...@troutnut.com wrote:
I haven't been able to fully make sense of the conflicting online information
about whether and how to specify nesting structure for a nested, mixed
model. I'll describe my experiment and hopefully somebody who knows lme4
Have you tried the 'sos' package?
install.packages('sos') # if not already installed
library(sos)
cr - ???'constrained regression' # found 149 matches
summary(cr) # in 69 packages
cr # opens a table in a browser listing all 169 matches with links to
the help pages
However, I agree
I am sorry, i think the link was broken..! here is the correct one!!!
http://www.4shared.com/file/4zV0g3JR/RF_80-85.html
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hello
I'm trying to render in 3D what I usually plot by image(), or image.plot()
from the library fields, followed by a map(world,add=TRUE) type of
command. More concretely, I have a field of temperature values, for a given
geographic area, and I would like to plot a 3D surface whose x and y axes
hierobarp or barNest from {plotrix} may do this more neatly.
2010/10/31 Sibylle Stöckli sibylle.stoec...@gmx.ch
Dear R users
I would like to group my barplot graph (see example on the R help
link). The proposed R code, adding individual bars to the plot, looks
really overwhelming. My
On Oct 31, 2010, at 12:54 PM, Spencer Graves wrote:
Have you tried the 'sos' package?
I have, and I am taking this opportunity to load it with my .Rprofile
to make it more accessible. It works very well. Very clean display. I
also have constructed a variant of RSiteSearch that I find
Thanks, but I just don't know how to translate that to a dataset with
rows and columns.
Initially, I was thinking about something like that:
# Create some data:
a - c(10,20,15,43,76,41,25,46)
b - factor(c(m, w, m, w, m, w, m, w))
c - c(2,5,8,3,6,1,5,6)
number - c(1:8)
myframe - data.frame(a,b,c,
firsthalf - myframe[v1,]
or
firsthalf - subset(myframe, number %in% v1)
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/Randomly-split-a-sample-in-two-equal-subsamples-tp3021140p3021353.html
Sent from the R help mailing list archive at Nabble.com.
Of course you are right that this would not be appropriate in general, but
what I'm doing--which as Baptiste explained can be done much more nicely
with unlist()---seems reasonable in my context: The dataframe has a computed
statistic for each input, but I need a vector so that I can do operations
On 31.10.2010 11:30, Santosh Srinivas wrote:
Dear Group, any idea how I can download the source code for all packages in
Windows 7?
Either apply wget on yourCRANmirror/src/contrib/
or
- choose CRAN mirror
- select CRAN as the only repository (unless yoiu want other packages as
well)
-
Dear All,
I have some questions about probit regressions.
I saw a nice introduction at
http://bit.ly/bU9xL5
and I mainly have two questions.
(1) The first is almost about data manipulation. Consider the following
snippet
##
mydata -
Thanks, it works!
--
View this message in context:
http://r.789695.n4.nabble.com/Randomly-split-a-sample-in-two-equal-subsamples-tp3021140p3021365.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On Sun, Oct 31, 2010 at 12:11 PM, baptiste auguie
baptiste.aug...@googlemail.com wrote:
Hi,
I think you want ?unlist
d = data.frame(x=1, y=2, z=3)
v = unlist(d)
is(v)
[1] numeric vector
Here are a few other possibilities too:
drop(as.matrix(d))
do.call(c, d)
sapply(d,
Hi All,
I'm trying to get a summary table of my datasets, in which I want the
mean of different groups calculated and presented in a table. I want
this table to easily be exported to LaTeX. However, I'm not able to
remove the N in this summary table. It gives the following error:
Error in
Dear all:
when I use parse() there is some problems. Below is an example:
b0-1
b1-1
x-1
str2expr-function(x){eval(parse(text=x))}
test1-b0+b1*sqrt(x)
test2-b0+b1
str2expr(test1)
str2expr(test2)
it can work well for test2 but not for test1.
Could you tell me how to fix this problem or is there
On 31/10/2010 3:22 PM, Yilong Zhang wrote:
Dear all:
when I use parse() there is some problems. Below is an example:
b0-1
b1-1
x-1
str2expr-function(x){eval(parse(text=x))}
test1-b0+b1*sqrt(x)
test2-b0+b1
str2expr(test1)
str2expr(test2)
it can work well for test2 but not for test1.
Could you
On Oct 31, 2010, at 3:22 PM, Yilong Zhang wrote:
Dear all:
when I use parse() there is some problems. Below is an example:
b0-1
b1-1
x-1
str2expr-function(x){eval(parse(text=x))}
test1-b0+b1*sqrt(x)
test2-b0+b1
str2expr(test1)
str2expr(test2)
I don't think the scoping rules are up to the
On 31/10/2010 1:29 PM, claudia tebaldi wrote:
Hello
I'm trying to render in 3D what I usually plot by image(), or image.plot()
from the library fields, followed by a map(world,add=TRUE) type of
command. More concretely, I have a field of temperature values, for a given
geographic area, and I
Hi Duncan:
I'm curious about the environment setting. ?eval says:
If envir is not specified, then the default is parent.frame() (the
environment where the call to eval was made).
So what's the difference between set envir=parent.frame() or not?
Thank you.
Wu
-
A R learner.
--
View
On 31/10/2010 4:47 PM, Wu Gong wrote:
Hi Duncan:
I'm curious about the environment setting. ?eval says:
If envir is not specified, then the default is parent.frame() (the
environment where the call to eval was made).
So what's the difference between set envir=parent.frame() or not?
If you
Ok I downloaded it and showed you how to get your data out. How to read it
into a raster brick,
how to plot the data, how to get the mean rainfall of every day.lots more
you can do.
there is a bad bit of data in the last time step.
check my blog.
In the future what you should do is write code
Hi,
Using the code below I got almost a 60% speedup. Obviously this is
largely dependent on there being relatively fewer columns than rows.
HTH,
Josh
#
## Create data
h - structure(c(0.25, 0.25, 0, 0, 0, 0, -0.25, -0.25, -0.25, -0.25,
-0.5, -0.5, 0, 0.25, 0.25,
Actually, I'm able to gain another second by limiting -/+s in the
subscripts (maybe just an artifact? I ran it a couple of times to
check, but still).
system.time(for(k in 22:2) {
tmp - xx.2 * v.2[, k]
for(j in 2:1) {
vv.2[j, k] - min(tmp[j], vv.2[j+1, k])
}
v.2[-1, k-1] - h.2[1,
Hi all,
Just following on from a previous thread (for loop). Is there a parallel
'for' loop like matlab (parfor maybe?). I know there was a Nvidia GPU
version for blas somewhere. But is there a CPU or a GPU version of the for
loop?
Thanks,
Sachin
p.s. sorry about the corporate notice below:
Take a look at the parallel computing section of:
http://cran.r-project.org/web/views/HighPerformanceComputing.html
specifically the line concerning the foreach package.
Jeff.
On Sun, Oct 31, 2010 at 6:38 PM,
sachinthaka.abeyward...@allianz.com.au wrote:
Hi all,
Just following on from a
Hi all,
I'm trying to run Rserve on windows RGui. It installs successfully but when
I use Rserve() to invoke the service it shows following error:
The program can't start because R.dll is missing from your computer. Try
reinstalling the program to fix this problem. I even tried reinstalling R
HI, Dear R community,
I have the following codes to calculate the commulative coverage. I want to
save the output in a vector, How to do this?
test-seq(10, 342, by=2)
#cover is a vector
cover_per-function (cover) {
for (i in min(cover):max(cover)) {print(100*sum(ifelse(cover = i, 1,
Hi Changbin,
The yek is that you need to save the results of your for loop rather
than just printing it. It also may be possible to vectorize your for
loop which might simplify things and speed them up, but I did not look
at that. Here is one way to save the results, see inline comments for
On Oct 31, 2010, at 8:35 PM, Changbin Du wrote:
HI, Dear R community,
I have the following codes to calculate the commulative coverage.
Not sure exactly what you mean by this. My guess is implemented below.
I want to
save the output in a vector, How to do this?
test-seq(10, 342, by=2)
On Sun, Oct 31, 2010 at 5:44 PM, Joshua Wiley jwiley.ps...@gmail.com wrote:
snip
#cover is a vector
cover_per - function(cover) {
## create a vector to store the results of your for loop
output - vector(numeric, length(min(cover):max(cover)))
for (i in min(cover):max(cover)) {
##
HI, David, Juan, and Joshua,
Thanks so much for your help! The following codes works. Appreciated!
test-seq(10, 342, by=2)
#data is a vector
cover_per-function (data) {
output-vector(numeric,length(min(data):max(data)))
for (i in min(data):max(data)) {
Thanks Joshua! Yes, i is not going up sequentially by 1, as i here is the
raw number of reads for each DNA base. Thanks so much for the great help!
On Sun, Oct 31, 2010 at 6:03 PM, Joshua Wiley jwiley.ps...@gmail.comwrote:
On Sun, Oct 31, 2010 at 5:44 PM, Joshua Wiley jwiley.ps...@gmail.com
I thought I would 'add' some meat to the problem I sent. This is all I know
(1) f = a*X1 + (1-a)*X2
(2) I know n values of f and X1 which happens to be probabilities
(3) I know nothing about X2 except that it also lies in (0,1)
(4) X1 is the probability under the null (fisher's exact test) and X2
I'm trying to understand how to plot individual growth curve trajectories,
with the overall mean trajectory superimposed (preferably in a slightly
thicker line, maybe in black) over the individual trajectories. Using the
sleepstudy data in lme4, here is the code I have so far:
library(lme4)
in line
On 10/31/2010 6:26 PM, Jim Silverton wrote:
I thought I would 'add' some meat to the problem I sent. This is all I know
(1) f = a*X1 + (1-a)*X2
How do you know f = a*X1 + (1-a)*X2?
Why does this relationship make more sense than, e.g., log(f/(1-f)) =
a*X1 + (1-a)*X2?
(2) I
jlwoodard john.woodard at wayne.edu writes:
I'm trying to understand how to plot individual growth curve trajectories,
with the overall mean trajectory superimposed (preferably in a slightly
thicker line, maybe in black) over the individual trajectories. Using the
sleepstudy data in
Hello,
What I really want to do is to add a rejection region in the
form of a long rectangle to a density plot I have drawn.
I am getting 2 plots.
How can I add rectangle to first plot? see code below.
First section works fine. It just is not quite what I want.
# NORMAL DISTRIBUTION
Thank you so much, Michael. This solution is just what I was looking for.
Many thanks!
John
--
View this message in context:
http://r.789695.n4.nabble.com/Mean-and-individual-growth-curve-trajectories-tp3021672p3021746.html
Sent from the R help mailing list archive at Nabble.com.
58 matches
Mail list logo