similar to: removing ROWS with missing values

Displaying 20 results from an estimated 2000 matches similar to: "removing ROWS with missing values"

2006 Jul 13
1
Scalling/Centering the Data by an Index
Dear All: I would like to center the data in 'x' by 'group'. The following code scale the data and I have not been able to figure out how to change it so I get the centered data. x <- c(1, 2, 3, 4, 5, 6, 7, 8) group <- c(1,1,1,2,2,2,2,2) unsplit(lapply(split(x,group),scale),group) I would appreciate your help. Ashraf
2006 Mar 22
1
lme convergence
Dear All: lme(sbp ~ cengirth, data = family, random= ~ 1 | familyid) converges but lme(sbp ~ cengirth, data = family, random= ~ cengirth | familyid) does not. I get the following message: Error in lme.formula(sbp ~ cengirth, data = family, random = ~cengirth | : iteration limit reached without convergence (9) The data has 488 rows and 154 familyid levels. For
2004 Dec 17
1
Confidence Intervals from Bootstrap Replications
Hi All: I have to compute bootstrap confidence intervals, the statistic (incremental cost effectiveness ratio) is computed from two samples (intervention and control) of different sizes. All the bootstrap functions that I have seen use one dataset as argument. I may go ahead and get the desired number of bootstrap replications separately. I would appreciate if you could point me to a source of a
2005 Aug 04
1
Where the error message comes from?
Hi all: I get the following error message that I am not able to resolve. Error in if (const(t, min(1e-08, mean(t)/1e+06))) { : missing value where TRUE/FALSE needed It appears right before the last data.frame statement. Below is the program that simulates data from one way random effects model and then computes normality and bootstrap confidence interval for
2005 Apr 03
4
Generating a binomial random variable correlated with a normal random variable
Hi All: I would like to generate a binomial random variable that correlates with a normal random variables with a specified correlation. Off course, the correlation coefficient would not be same at each run because of randomness. I greatly appreciate your input. Ashraf
2005 Apr 13
2
extracting one element of correlation matrices from a list poroduced by the 'by' statement
I am producing 2X2 correlation matrices by a class variable. I need to extract a vector of correlation coefficients only. I am doing that in a loop (see below) but I am sure there would be a simpler way. Please help! > by(d1[,c(2,3)],d1[,1],cor) d1[, 1]: 1 c e c 1.0000000 0.1972309 e 0.1972309 1.0000000
2006 Jul 29
0
Help with clogit in survival - conditional logistic regression
Dear All: I have been struggling to run the conditional logistic regression on a dataset. I am using clogit function in survival package. Here is how the data is generated. I tried to shorted the data by using the second count variable but still the clogit did not run. Why I am not able to run clogit on my dataset. I appreciate any input. Regards, Ashraf age <- c(rep(0,8),rep(1,8)) scc <-
2006 Apr 04
2
Selecting out certain values from a MATRIX
I have two objects, one matrix and one vector. I want to use my vector to subset certain values out of my matrix. For example: I want to tell R, to select out all rows in myMatrix into a new myMatrix2 IF that corresponding row is less than a 0.5 in myVector. So: myMatrix = a matrix of 8000 by 20 myVector = vector of 8000 myMatrix2 = a matrix of < 8000 by 20 (based on selection criteria in
2005 Apr 03
3
'skewing' a normal random variable
Hi All; The following question is directed more to statisticians on the list. Suppose I have a normal random variable. Is there a transformation that I can apply so that the new variable is slightly positively skewed. I greatly appreciate your help. Ashraf
2006 Mar 15
2
generating RANDOM ROWS from matrix
Dear group, I would like to generate a 1000 random rows from a MATRIX with dimensions 12,000 by 20 (i.e. to generate a 1000 by 20 matrix of random rows) Does the function sample() work for this??? thank you in advance [[alternative HTML version deleted]]
2006 Mar 07
7
reading in only one column from text file
How do I manipulate the read.table function to read in only the 2nd column??? [[alternative HTML version deleted]]
2005 Nov 21
2
Removing Rows
I have a data frame with the following dimensions 217 x 5 I want to create two data frames from the original. 1) One containing every tenth row of the original data frame 2) Other containing the rest of the rows. How do I do this? I've tried subset() and calling the index. thank you in advance, [[alternative HTML version deleted]]
2006 Apr 02
2
VARIANCE across each ROW
I have a very large matrix. I would like to display the variance across each row. In other words, I want to output a vector containing the values of variance across row. When I use the function var(), it seems to give me the variability of each column. Any ideas?? [[alternative HTML version deleted]]
2006 Mar 21
3
ROWNAMES error message
I am getting an error message, which I do not know the source to. I have a matrix SAMPLES that has preexisting rownames that I would like to change. GENE_NAMES contains these rownames. > rownames(SAMPLES) = GENE_NAMES Error in "dimnames<-.data.frame"(`*tmp*`, value = list(list(V1 = c(3843, : invalid 'dimnames' given for data frame > dim(SAMPLES) [1] 12626
2013 Jun 27
3
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum? #I am tryign to use rollapply to calcualte a moving sum? #I tried rollapply and get the error message #"Error in seq.default(start.at, NROW(data), by = by) : # wrong sign in 'by' argument" #example: mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20) ) mymatrix_cumsum <- ( matrix(data=NA, nrow=5,
2009 Jul 20
1
S4 method dispatch with inheritance
Hi, I'm trying to create a new S4 class (myMatrix) which for now just extends dgCMatrix (from package Matrix). Then I want to use "[" which is defined in Matrix. Out of the box with "[" (defined in Matrix) I lose the class information and the result is an object of class dgCMatrix. If I specify a "["-method for myMatrix, it is not used because a signature
2005 Jan 21
6
Avoiding a Loop?
Dear R-Helpers, I have a matrix where the first column is known. The second column is the result of multiplying this first column with a constant "const". The third column is the result of multiplying the second column with "const"..... So far, I did it like this (as a simplified example): nr.of.columns <- 4 myconstant <- 27.5 mymatrix <- matrix(numeric(0), nrow=5,
2009 Aug 22
6
Fw: Re: my bootlog
Fasiha Ashraf --- On Sat, 22/8/09, Fasiha Ashraf <feehapk@yahoo.co.in> wrote: From: Fasiha Ashraf <feehapk@yahoo.co.in> Subject: Re: [Xen-users] my bootlog To: "Boris Derzhavets" <bderzhavets@yahoo.com> Date: Saturday, 22 August, 2009, 11:12 AM Please check what wrong here grub.conf        title Fedora (2.6.30-rc6-tip)         root (hd0,6)         kernel
2005 Feb 21
3
Sorting a matrix on two columns
Hello, If a matrix with 5 columns has been defined and the first two columns need to be sorted in ascending order, how can this be achieved whilst ensuring the other 3 columns data are in relative position to the sorted columns? Glen Jones [[alternative HTML version deleted]]
2017 Sep 26
2
build a SpatialLines object from a list
Hi Eric, Thanks for the help.But this will not solve the problem as it will generate a list and what I need is an object of class sp using SpatialLine function from sp package.So, I need to convert each matrix to coordinates and then to a line and then to a spatial line as figured in the code. My data structure is a list of 141 matrices.Each matrix represents coordinates of the river lines