Displaying 20 results from an estimated 3000 matches similar to: "plotting gaussian data"
2006 Sep 29
1
linear gradient in nls
Hello,
I hope this doesn't turn into a statistics question but here I
go. I am using the nls function with a Gaussian distribution, see coding
below. When I run the nls I get an error back saying that I have a linear
gradient. I then, of course am unable to do anything else. The data that I
am using are intensity values from some mass spectrometry data. Is there
something I can
2006 May 23
2
nls: formula error?
So thanks for the help,
I have a matrix (AB) which in the first column has my bin numbers so -4 - +4
in 0.1 bin units. Then I have in the second column the frequency from some
data. I have plotted them and they look roughly Gaussian. So I want to fit
them/ find/optimize "mu", "sigma", and "A".
So I call the nls function :
nls_AB <- nls(x ~ (A/sig*sqrt(2*pi))*
2007 Jan 19
3
if else statement
Hello,
I'm doing some scripting and I've noticed that R doesn't seem to
have an
if (cond){
do
}ifelse (cond) {
do
} else {
do
}
type block.
Is this correct or am I missing something.
THX
Paul
--
Research Technician
Mass Spectrometry
o The
/
o Scripps
\
o Research
/
o Institute
2006 Jun 30
2
Passing arguments to glm()
Hi there
I want to pass arguments (i.e. the response variable and the subset
argument) in a self-made function to glm.
Here is one way I can do this:
f.myglm <- function(y,subfact,subval) {
glm(d.mydata[,y]~d.mydata[,'x1'],family=binomial,subset=d.mydata[,subfact]==subval)
}
> str(d.mydata)
`data.frame': 15806 obs. of 3 variables:
$ y : Factor w/ 2 levels
2006 Nov 29
3
better define: matrix comparison and cbind issue
Hello,
Sorry to all for the lack of communication, and thanks to those with the
suggestions.
So I have two matrixes which are different sizes, same column number but
different row number.
What I would like to do is to compare A to B. In the 6 and 9th column there
are ref numbers (molecular masses to be exact). I would like to check A and
B by these columns. If I find that the number in A[9,x]
2006 Jul 06
2
questions on data management
Dear friends,
suppose i have two datasets: A and B
A:
id<-1:6
x<-c(1,2,3,4,5,6)
y<-c(2,4,6,8,3,2)
xy<-data.frame(id,x,y)
B
m<-c(1,1,3,3,5,5)
n<-c(2,2,6,6,3,3)
mn<-data.frame(m,n)
Now, i want to perfomr two tasks:
1. get a subset of B,no duplicate values,:
C:
m n
1 2
3 6
5 3
2.Extract the values in A on the conditions that x=m and y=n
the results should be:
id x y
1 1 2
3
2006 Jul 18
2
A contingency table of counts by case
Here is an example of the data.frame that I have,
df<-data.frame("case"=rep(1:5,each=9),"id"=rep(1:9,times=5),"x"=round(runif(length(rep(1:5,each=9)))))
"case" represents the cases,
"id" the persons, and
"x" is the binary state.
I would like to know in how many cases any two persons
a. both have "1",
b. the first has
2007 Jun 18
2
data type for block data?
Dear All,
I have a matrix with data that is not organised. I would like to go
through this and extract it. Each feature has 2 vectors which express
the data. I also have an index of the places where the data should be cut.
eg.
>class(cc)
"matrix"
>cc
[,1] [,2]
[1,] 1 26
[2,] 2 27
[3,] 3 28
[4,] 4 29
[5,] 5 30
[6,] 6 31
[7,] 7 32
2007 Aug 28
4
Nodes & edges with similarity matrix
Hello,
I apologise if someone has already answered this but I searched and
googled but didn't find anything.
I have a matrix which gives me the similarity of each item to each
other. I would like to turn this matrix into something like what they
have in the graph package with the nodes and edges.
http://cran.r-project.org/doc/packages/graph.pdf . However I cannot find
a method to
2006 Jun 13
3
if syntax error :(
Umm sorry to bother everyone again but I'm having trouble with my if
statement. I come from a perl background so that's probably my problem! :)
So here is my code:
if (any(lgAB>4) | any(lgAB<-4)){
freq_AB<-hist(lgAB, type="o", plot=F)
else
freq_AB<-hist(lgAB, breaks=br,type ="o", plot=F)
}
And I get
> source("E:/R/GMDA-1.1.R")
Error in
2007 Jun 22
2
One file open or locked way too many times. How to fix?
A Windows 2000 Server is a member server of the domain. The domain
server is CentOS 4.5 with all updates and Samba 3.0.24 built using the
packaging/RHEL/makerpms.sh script. The W2k server is opening this file
on the samba server.
This problem started several versions of CentOS and Samba ago, and I did
the upgrades thinking it would fix it. It did not.
It seems to be "locking" or
2007 Apr 24
2
negative number to positive number
Hello all,
I know this is a pretty easy question but I can't find it in S poetry or
R help.
How can I make a negative number positive. Such as
-5 to be +5
I tried +(-5), but that didn't work.
So no, I don't mean taking a -5^2 just to get a positive number.
This is in a function so it's not just -5 it's x. :)
Thanks,
Paul
--
Research Technician
Mass Spectrometry
o The
2011 Jan 26
1
aggregate(as.formula("some formula"), data, function) error when called from in a function
I'm having a problem with aggregate.formula when I call it in a function and the function is converted from a string in the funtion
I think my problem may also only occur when the left hand side of the formula is cbind(...)
Here is example code that generates a dataset and then the error.
The first function "agg2" fails
> agg2(FALSE)
do agg 2
Error in m[[2L]][[2L]] : object
2006 Sep 26
2
Vectorise a for loop?
Hi R guru coders
I wrote a bit of code to add a new column onto a "topTable" dataframe.
That is a list of genes processed using the limma package. I used a for
loop but I kept feeling there was a better way using a more vector
oriented approach. I looked at several commands such as "apply", "by"
etc but could not find a good way to do it. I have this feeling there
2003 Jun 18
2
Forward stepwise procedure w/ stepAIC
I'm attempting to select a model using stepAIC. I want to use a forward
selection procedure. I have specified a "scope" option, but must not be
understanding how this works. My results indicate that the procedure begins
and ends with the "full" model (i.e., all 17 independent variables)...not
what I expected. Could someone please point out what I'm not
2012 Dec 13
1
How do I make a loop to extract a column from multiple lists and then bind them together to make a new matrix?
Hi! I am new to looping and R in general; and I have sent waaaay to much
time on this one problem and am about a hair away from doing it manually
for the next two days.
So, there is a package that while calculating the statistic creates lists
(that look like matrices) in the background. Each item (there are 10
items) has one of these ‘matrix looking list’ that I need to extract data
from. The
2007 Oct 16
2
histogram labels
Dear all,
Just a quick one, hopefully. I have a histogram made from the method
'hist()'. How do I get labels on the bars? Such that the bars will have
the x axis on the bar, not the frequency of the point but the number of
the point itself. To make a quick summary, I want the the numbers from
'losses' (below) to be on the bar's.
Thanks,
Paul
2005 Oct 17
3
Error Executing sampledec in VC++
hey guys, I just compiled an application similar to sampledec.c (for speex
1.1.10) and it was fine but when I executed it, the app exited without doing
anything. I'm using MS VC 6.0 and this was all I got - First-chance
exception in sampledec.exe : 0xC0000005: Access Violation. Has anyone
encountered this / does anyone know how to deal with it? by the way,
sampleenc executed perfectly...
When
2010 Sep 04
3
How can I fixe convergence=1 in optim
Hi R users,
I am using the optim funciton to maximize a log likelihood function. My
code is as follows:
p<-optim(c(-0.2392925,0.4653128,-0.8332286, 0.0657, -0.0031, -0.00245,
3.366, 0.5885, -0.00008,
0.0786,-0.00292,-0.00081, 3.266, -0.3632, -0.000049, 0.1856,
0.00394, -0.00193, -0.889, 0.5379, -0.000063,
0.213, 0.00338, -0.00026, -0.8912, -0.3023, -0.000056), f,
2008 May 08
2
anova p value extraction
hello all,
Quick question, how do I get the p value out of the anova?
Thanks,
Paul
> pb<-aov(as.numeric(diff[5,16:33]) ~ grF)
> summary(pb)
Df Sum Sq Mean Sq F value Pr(>F)
grF 3 2.7860e+10 9.2867e+09 4.2236 0.02534 *
Residuals 14 3.0783e+10 2.1988e+09
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '