Displaying 15 results from an estimated 15 matches for "alex99".
2008 Oct 23
3
Fuctions help!
Hi everyone,
I have a question about functions. I have two functions:
Sampling=function(fname,Total,nSample,nPatient){......return(list(Gmean,Gsd))}
Power=function(alfa,m1,m2,s1,s2,n1,n2){....return(powe)}
I want to use "Gmean" and "Gsd" which are the returned values from
"Sampling" function, in "Power" function.
i.e. when I call "power" I want
2008 Oct 20
2
calculating mean for samples
Hi everyone,
> does any one knows how can I calculate mean for different samples
> i.e. I have a data like this:
>
> s1 s2 s3 s4
> 1 0 0 0 1
> 2 1 0 1 0
> 3 0 0 0 0
> 4 0 0 0 0
> 5 0 1 0 1
> 6 1 0 0 0
> 7 0 0 0 0
> 8 0 0 0 0
> 9 0 0 0 0
> 10 0 0 0 1
>
> I need to make 5 different sample with 5
2008 Oct 15
3
Standard deviation for rows
Hi everyone,
I have just started using R, and I have a simple question.
How can I get the Standard deviation for rows. basically I am looking for
something like "rowMeans()"
but for Standard deviation (I tried "rowSds()" didn't exist)
Thanks,
--
View this message in context: http://www.nabble.com/Standard-deviation-for-rows-tp19998106p19998106.html
Sent from the R
2008 Oct 15
2
Help Help with sampling
Hi everyone,
I have a dataset(named "Mydata") which includes 4 different variables named;
s1,s2,s3,s4 .Each variable(symptom) has 14 patients.
I need to use random sampling to make, 5 different samples from my data with
5 patients in each sample. i.e. using all 4 variables I need to make 5
different samples by changing patients(with 5 patients in each sample).
X8 X9 X10 X102 X110
2008 Oct 21
2
Inserting a new row in a matrix
Hi guys,
I need to insert a row to a matrix in a for loop. I have matrix named "Avg"
which is a 5x4 matrix of zeros.
I have a file named "A"(4 rows,14 columns) which I make a sample of it 5
times. each time I get the mean for each column and put the result in the
"Avg" matrix. this is my code:
Avg=matrix(0,5,4)
>
> for(i in 1:5){
+ res=(A[sample(nrow(A),
2008 Oct 16
2
saving result of a "for" loop
Hi everyone,
I have dataset which I take random samples of it 5 times. each time I get
the mean for rows for each sample.
at the end I need to calculate the Average of all means for each sample and
each row. to clear it up I give an example:
say this is my dataset.
X8 X9X10X12 X13 X14 X15 X16X17X18X19 X20 X21 X22
s1 0 1 0 0 0 1 0 0 0 0 0 0 0 0
s2 0 0 0
2008 Oct 17
2
function help
Hi everyone,
I have dataset which I make a sample of it couple of times and each time I
get the mean and standard deviation of each row for each sample. I have a
function for that, which takes the name of the file and number of times to
sample and then returns the mean and standard deviation for each row in each
sample.
Sample=function(name, n){
2008 Oct 10
1
Sampling
Hi Guys,
I am in desperate need with sampling. I am suppose to sample from a dataset.
I use the following code:
> for(i in 1:5){temp[i]<-sample(T2,40,replace=F)
+ show(temp)}
but all the samples are the same, but I want them to be different.any
suggestion?
Thanks
--
View this message in context: http://www.nabble.com/Sampling-tp19923768p19923768.html
Sent from the R help mailing list
2008 Oct 21
1
Error in sample(colnames(B), 10) : invalid 'x' argument
HI,
I have a file named "s1"(which has 14 rows and 4 columns) which is in csv
format. I import and call it "A" the file using:
A <- read.csv(file="s1.csv",head=TRUE,sep=",")
then I transpose it and call it "B"(which will have 4 rows and 14 columns)
using:
B=t(A)
when I want to make 5 samples from "B" (choosing 10 columns) using:
2008 Nov 07
1
Help With Graphs
Hi guys,
I am truing to draw a circle and choose 10 points on the circle and put a
number from 1 to 10 above each point. I don't have a problem with drawing a
circle and choosing 10 points. my problem is with numbering . is it even
possible to put a number above each chosen point? if so any idea how to do
it?
ps: the circle has red dots and the selected points are in black.
here is my code:
2008 Oct 29
1
Help with Plots
Hi there,
I am trying to have a connectivity graph (two plots at once) in R:
this is an example:
x1=sin((0:100)*2*pi/100)
y1=cos((0:100)*2*pi/100)
plot(x1,y1)
will draw a circle and
x2=c(1,9,3,4,8,4,2,0)
y2=c(3,6,8,2,4,1,9,6)
plot(x2,y2,type="b")
will draw a graph with corresponding x's and y's and connects the point.
I want to have a circle with these points connected to
2008 Dec 01
1
Error: "subscript out of bounds"
Hi All,
I am trying to replace the "NA" values in a matrix by using the following
function:
it gets a "name" of the matrix or list or vector and turns it to a matrix
called "m".
then checks the elements of the matrix and if any of them is "NA" replace
them with "0".
rep=function(name){
m=as.matrix(name)
for(i in 1:length(m)){
for(j in
2008 Oct 22
2
Help with functions
Hi there,
I have a the following function which takes a name(fname), total number of
rows (Total), number of times to make a sample(nSample), number of
records/rows to be included in each sample(nPatient). then it generates
required samples and calculates the mean and standard deviation of the
columns for each sample and finally in calculates the grand mean and
standard deviation.
The problem
2008 Nov 27
0
Help with "replicate"
Hello everyone,
I have a file called "trans" which has 100 records (rows) and 60 columns.
I need to make 2 samples (with 5 records in each) out of this file with no
replacement, so I used "replicate".
The sampling part works fine and I called the outcome "result".
my problem is then I need to calculate the correlation matrix for each
sample. I used