Displaying 20 results from an estimated 10000 matches similar to: "Error in sample(colnames(B), 10) : invalid 'x' argument"
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 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 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 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 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 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 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 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 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 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 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
2007 Oct 31
3
Find A, given B where B=A'A
Given a matrix B, where B=A'A, how can I find A?
In other words, if I have a matrix B which I know is another matrix A times
its transpose, can I find matrix A?
Thanks,
Mike
2001 Aug 02
1
sample()
Dear R users,
is there a way to extract directly rows instead of column vectors
using the function sample()?
I have already tried to transpose and back-transpose my dataframe,
but I couldn't manage to get rid off the levels in the resulting
dataframe.
Macintosh G4 (Mac OS9.1), R Version 1.3.0
Any help is welcome!
Christof
--
Christof Bigler
Mountain Forest Ecology
ETH-Zentrum HG G21.4
2023 Nov 06
3
[Bug 3631] New: ssh fe80 -b invalid argument failure
https://bugzilla.mindrot.org/show_bug.cgi?id=3631
Bug ID: 3631
Summary: ssh fe80 -b invalid argument failure
Product: Portable OpenSSH
Version: 8.9p1
Hardware: Other
OS: Linux
Status: NEW
Severity: enhancement
Priority: P5
Component: ssh
Assignee: unassigned-bugs at
2005 Oct 05
2
eliminate t() and %*% using crossprod() and solve(A,b)
Hi
I have a square matrix Ainv of size N-by-N where N ~ 1000
I have a rectangular matrix H of size N by n where n ~ 4.
I have a vector d of length N.
I need X = solve(t(H) %*% Ainv %*% H) %*% t(H) %*% Ainv %*% d
and
H %*% X.
It is possible to rewrite X in the recommended crossprod way:
X <- solve(quad.form(Ainv, H), crossprod(crossprod(Ainv, H), d))
where quad.form() is a little
2009 Mar 11
3
[LLVMdev] Stack overflow in Legalize Op
I'm hitting an issue where legalizeOp is overflowing the stack. Are
there any recommended ways of getting around this?
The bitcode that causes this issue is attached.
Thanks,
Micah Villmow
Systems Engineer
Advanced Technology & Performance
Advanced Micro Devices Inc.
S1-609 One AMD Place
Sunnyvale, CA. 94085
P: 408-749-3966
-------------- next part --------------
An
2003 Oct 13
2
colnames from submatrix?
Hi R-Wizards:
I've looking through the R docs and have yet to find what I'm looking for
and have tried a few intermediate steps to now avail yet and rather than
spend another few hours looking for the solution, I figured I would post a
message.
I have a matrix (actually a set of them) that I want to pull all the names
of the non-zero columns into a vector/list for further processing:
2003 Oct 23
1
Variance-covariance matrix for beta hat and b hat from lme
Dear all,
Given a LME model (following the notation of Pinheiro and Bates 2000) y_i
= X_i*beta + Z_i*b_i + e_i, is it possible to extract the
variance-covariance matrix for the estimated beta_i hat and b_i hat from the
lme fitted object?
The reason for needing this is because I want to have interval prediction on
the predicted values (at level = 0:1). The "predict.lme" seems to
2011 Apr 12
5
B %*% t(B) = R , then solve for B
Hello,..
Apologies for the newbie question but...
I have a matrix R, and I know that *B %*% t(b) = R*
*I'm trying to solve for B *(aka. 'factoring the correlation matrix' I
think)
Please help!
I've read that 'to solve for B we define the eigenvalues of R and then
apply the techniques of Principal Component Analysis'
This made me reach for princomp() but now I'm
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