similar to: Pairwise Partitioning of a Vector

Displaying 20 results from an estimated 100 matches similar to: "Pairwise Partitioning of a Vector"

2008 Jun 23
2
Create a new vector with filled with mean value of original vector
Hi, Given this vector: > x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , 113.9) [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 > mean.x <- mean(x) [1] 79.63 I wish to: 1. Create a new vector (nx) with the same size as "x" 2. Fill "nx" with the mean value thus in the end I hope to get something like: [1] 79.63
2008 Jun 12
1
Data.matrix fail to convert data.frame into matrix
Hi, With the following codes, I attempt to convert the data.frame into a matrix. However I notice that data.matrix function doesn't seem to work. __ BEGIN__ dat <- read.table("mydata", comment.char = "!" , na.strings = "null"); # Select n-genes by random sample # n = 1 nosamp <- 1 geneid <- sequence(nrow(dat)) geneid.samp <- sample(geneid,nosamp)
2012 Feb 22
3
gamlss results for EXP and LNO seem to have reversed AIC scores
Hi, I'm a bit puzzled by the gamlss fitting of exponential and lognormal data. Gamlss seems to think that exponentially distributed data fits better with a lognormal distribution, and vice versa. For example, X <- rexp(1000) Gexp <- gamlss(X~1,family=EXP) # X~1 is X tilde 1 GAMLSS-RS iteration 1: Global Deviance = 2037.825 GAMLSS-RS iteration 2: Global Deviance = 2037.825 Glno
2012 Dec 07
1
Error using constrOptim in constraint definition
Hello, I'm trying to run constrOptim. It returns to me an error about the fact that constraints arguments (ui and ci) are non compatibles: > optout= constrOptim(startparams, f=ImpulseSS, grad=grImpulse, ui=UI, ci=CI, data=gexp[k,], t=t) Error in ui %*% theta : non-conformable arguments I would like to point out that I can calculate that product in the command line: > UI %*%
2008 Jul 01
1
Plotting Bi-Gamma Distribution
Hi all, I've tried to plot a vector which has two peaks in the density. This link shows the figure. http://docs.google.com/View?docid=dcvdrfrh_1dk9r2rc7 The red line is normal curve and green line is gamma curve. Notice that red line can correctly fit the histogram that has two peaks (i.e. red curve also has two peaks). But the gamma curve there only has one curve. Is there a way I can
2008 Jun 23
1
How to access data structure (List of List)
Hi, I have this kind of output. > str(nw) List of 3 $ :List of 2 ..$ part1: num 30.9 ..$ part2: num [1:78] 60.1 70.0 73.0 75.0 83.9 ... $ :List of 2 ..$ part1: num [1:2] 30.9 60.1 ..$ part2: num [1:77] 70.0 73.0 75.0 83.9 93.1 ... $ :List of 2 ..$ part1: num [1:3] 30.9 60.1 70 ..$ part2: num [1:76] 73.0 75.0 83.9 93.1 97.6 ... My question are: 1. What kind of data structure
2008 Jun 26
0
Unsqueezing Stacked Figures
Hi, I have two figures where I stacked together as one PNG. Top -> scatter plot Bottom -> density plot. However these two figures are squeezed together as rectangle figures each. (i.e. the y axes are compressed) Is there a way I can resize the figure? So that it can show proportional and complete plots? The code I have is the following: (I can also provide the figure if needed).
2003 Jan 17
2
read.table bug in Mac OS X (PR#2469)
Full_Name: George W. Gilchrist Version: 1.6.2 OS: OS X Submission from: (NULL) (128.239.124.126) Start with a tab-delimited or comma-delimited text file created on the Mac and use read.table("filename.txt", header=T) to read it in. When the first column of the file contains a character vector, and there is a header line, the first letter of the first column of the fifth row is appended
2010 Jul 12
1
What is the degrees of freedom in an nlme model
Dear all, I want to do a F test, which involves calculation of the degrees of freedom for the residuals. Now say, I have a nlme object "mod.nlme". I have two questions 1.How do I extract the degrees of freedom? 2.How is this degrees of freedom calculated in an nlme model? Thanks. Jun Shen Some sample code and data =================================================================
2010 May 26
2
writing function : can't find an object
Dear group, Here is my function: #return the daily PL for day y PLDaily<-function(x,y) { #find elements in my directory with "LSCPos" in the name, keep the numeric part in the name and #create a list l<-gsub("\\D","",dir()[grep("LSCPos",dir())]) #select in the list the desired elements
2010 May 13
2
long command line cut in 2 parts
Dear group, I have this command line in a function: zz<-merge(transform(merge(value,allcon,all.y=T),SHORTDESCRIPTION=NULL,VALUE= NULL,PL=-VALUE*pl,quantity=NULL),PosB,all.x=T,sort=F) I want to cut it in 2 lines (just for convenient purpose). Here is what I did : zz<-merge(transform(merge(value,allcon,all.y=T),SHORTDESCRIPTION=NULL, +
2013 May 03
2
Find the flow data from its accumulation of the panel data
Hi, I have the panel data of income statement of several banks. The date 9803 means 1998-Q1, 9806 means 1998-Q2, etc. I transform the date code to 1 (for 1998Q1), 2 (for 1998Q2), ...., 16 (for 2011Q4) where 1, 2, .... are placed in Col1. Now the income statement of a specific quarter is actually the accumulation from the beginning of the year. For example, the cost data of 1999Q3 is the
2003 Jan 17
1
More info - S-Plus compatability
Dear all, Thanks to those of you who have replied, the majority of the comments pointed out that the error caused by scan may originate from another function, and closer inspection of the output from traceback() reveals that it is in fact the read.table function where the error is originating from the full output of which I have included below. The error msg I recieve is Error in
2008 Dec 15
2
how to merge list of dataframes?
Dear all: I have a list of dataframes like this, i try to merge this lists of dataframes into one single dataframe, and keep ther column names as usual, how can i do this? i try lapply(aa,rbind), but it dose not work. Best regard! > summary(aa) Length Class Mode [1,] 3 data.frame list [2,] 3 data.frame list [3,] 3 data.frame list [4,] 3 data.frame
2010 Sep 16
2
question about converting a matrix to a dataframe
First I have a matrix called stocks1: > class(stocks1) [1] "matrix" Here are the first 5 rows of the last 4 columns: > stocks1[1:5,2:5] [,1] [,2] [,3] [,4] [1,] 80.73 31.95 25.4 25.69 [2,] 83.66 31.95 27.12 25.2 [3,] 83.27 32.93 28.74 26.29 [4,] 83.9 34.07 29.77 26.6 [5,] 82.74 35.18 30.24 27.41 Now, why can't I convert this into a dataframe?
2007 Mar 08
2
Removing duplicated rows within a matrix, with missing data as wildcards
I'd like to remove duplicated rows within a matrix, with missing data being treated as wildcards. For example > x <- matrix((1:3), 5, 3) > x[4,2] = NA > x[3,3] = NA > x [,1] [,2] [,3] [1,] 1 3 2 [2,] 2 1 3 [3,] 3 2 NA [4,] 1 NA 2 [5,] 2 1 3 I would like to obtain [,1] [,2] [,3] [1,] 1 3 2 [2,] 2 1 3
2005 Nov 11
0
Re: aec
> To everyone on the list: do *NOT* attempt to do echo cancellation with > signals sampled using different clocks. This will *NOT* work. Just a > 0.1% difference between the two sampling rates (it's sometimes worse > than that) means that the impulse response drifts by 8 samples every > second. There's just no way to efficiently track this. Or at least no > way that
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10 Windows 7 I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows: >
2011 Oct 25
2
extract data for specific levels factor
Dear all, I'm trying to analyze data with the following structure: ind cat tx age 40.2 por fol peq vh 35 41.9 por fol med vh 35 68.9 por fol preov vh 35 71.5 por fol peq ser 37 67.5 por fol med ser 37 76.9 por fol preov ser 37 78.7 por fol peq otr 37 78.3 por fol med otr 37 82.1 por fol
2006 Apr 23
1
Question about bicreg
Dear Adrian and Ian (and r-helpers), I encountered a curious result in developing an example using the bicreg function in the BMA package: I noticed that pairs of models with equal R^2 and equal numbers of predictors had nevertheless different BIC values. Looking at the bicreg function, the definition of BIC appears to be the usual one, or close to it [bic <- n * log(1 - r2/100) + (size - 1) *