similar to: cbind

Displaying 20 results from an estimated 80000 matches similar to: "cbind"

2010 Aug 19
2
Aspect Ratio
set.seed(1) x <- rnorm(n = 1000, mean = 0, sd = 1) plot(x = x, asp = 2000) Could someone please explain what the 'asp' parameter is doing?
2012 Apr 26
1
Hmisc::xYplot - text on xaxis
Hello, I'm making a simple plot using xYplot in the Hmisc library and having problems with labeling the values on the x-axis. Using the reproducible example below, how can I have the text (jan, feb,mar, etc.) in place of 1:12. Thanks, AB x <- c(seq(0,0.5,by=0.1),seq(0.5,0,by=-0.1)) ci <- rnorm(12,0,sd=0.1) xupper <- x + ci xlower <- x - ci mo.fac <- c("jan",
2012 Aug 23
1
NLS bi exponential Fit
Hi everyone, I'm trying to perform a bi exponential Fit with the package NLS. the plinear algorithm seems to be a good choice see: p<-3000 q<-1000 a<--0.03 b<--0.02 t<-seq(0:144);t y<-p*exp(a*t) + q*exp(b*t)+rnorm(t,sd=0.3*(p* exp(a*t) + q*exp(b*t))) fittA <- nls(y~cbind(exp(a*t), exp(b*t)), algorithm="plinear",start=list(a=-.1, b=-0.2), data=list(y=y, t=t),
2010 Jan 29
2
cbind, row names
Hello, I read the help as well as the examples, but I can not figure out why the following code does not produce the *given* row names, "x" and "y": x <- 1:20 y <- 21:40 rbind( x=cbind(N=length(x), M=mean(x), SD=sd(x)), y=cbind(N=length(y), M=mean(y), SD=sd(y)) ) Could you please help? Thank you S?ren
2007 Feb 28
3
matrix manipulations
Dear friends, I have a basic question with R. I'm generating a set of random variables and then combining them using the cbind statement. The code for that is given below. for (i in 1:100) { y <- rpois(i,lambda=10) X0 <- seq(1,1,length=i) X1 <- rnorm(i,mean=5,sd=10) X2 <- rnorm(i,mean=17,sd=12) X3 <- rnorm(i,mean=3, sd=24) ind <- rep(1:5,20) }
2024 Mar 26
2
Printout and saved results
How can I have both printout and saved results at the same time. The subroutine first return "out" and the printout gets printed, but not saved. I then run the "invisible" line. Results got saved and accessible but no printout. How can I have both printout and also have the results saved? Thank you! > dstat4 <- function(data,digits=3){ +?? Mean??? <-
2012 Jun 08
1
Saving estimates after nested loops
 Hi R-listers, Savings regression results after a loop is straightforward. But what about when you have nested loops? I am running a regression of the form  lm(y~1+x+M+ D[,i] + D[,j] + D[,k]) where x is the variable of interest. M and D are vectors with other covariates. Vectors "M" and "x" are included in every regression. Then i loop over the columns of D to use all
2004 Apr 04
1
How to improve this code?
Hi all, I've got some functioning code that I've literally taken hours to write. My 'R' coding is getting better...it used to take days :) I know I've done a poor job of optimizing the code. In addition, I'm missing an important step and don't know where to put it. So, three questions: 1) I'd like the resulting output to be sorted on distance (ascending) and
2010 Jun 11
3
Calculation of r squared from a linear regression
Hi, I'm trying to verify the calculation of coefficient of determination (r squared) for linear regression. I've done the calculation manually with a simple test case and using the definition of r squared outlined in summary(lm) help. There seems to be a discrepancy between the what R produced and the manual calculation. Does anyone know why this is so? What does the multiple r squared
2024 Mar 26
1
Printout and saved results
Not clear what you mean by "saved". If you call a function and the result is printed, the result is remembered for a wee while in the variable .Last.value, so you can do > function.with.interesting.result(.......) > retained.interesting.result <- .Last.value or even > .Last.value -> retained.interesting.result If you know before you start writing the expression that you
2006 Apr 25
4
Help needed
Hi, I am trying to change a SAS macro to R. here is my code. I get an error at the last line. attach(fram) dset1<-cbind(AGE,BMI,DEATH) > BMIGRP<-cut(BMI,breaks=3,right=TRUE) > AGEGRP<-floor(AGE/10)-2 > dset<-cbind(AGEGRP,BMIGRP,DEATH) > maxage<-max(dset[,1]) > minage<-min(dset[,1]) > #maxcls<-dset[,2] > #mincls<-dset[,2] >
2010 Apr 23
4
basic table statistics
Hi, I have a very simple question, but I'm obviously not able to solve the problem on my own. I have a data.frame like sample(c("A","B","C"),size=20,replace = T)->type rnorm(20)->value data.frame(ty=type,val=value)->test There must be some built in functions, that will do some descriptive statistics with tabular output, in the end I like to have
2011 Mar 20
2
Why unique(sample) decreases the performance ?
Hi, I' am interested in differences between sample's result when samples consist of full elements and consist of only distinct elements. When sample consist of full elements it take about 120 sec., but when consist of only distinct elements it take about 4.5 or 5 times more sec. I expected that opposite of this result, because unique(sample) has less elements than full sample. Code as
2024 Mar 26
1
Printout and saved results
I just like the subroutine to spit out results (Mean, Std.dev, etc.) and also be able to access the results for further processing, i.e., v$Mean v$Std.dev On 3/26/2024 11:24 AM, Richard O'Keefe wrote: > Not clear what you mean by "saved". > If you call a function and the result is printed, the result is > remembered for a wee while in > the variable .Last.value, so
2012 Apr 25
2
comparison of bivariate normal distributions
sorry for cross-posting Dear all, I have tow (several) bivariate distributions with a known mean and variance-covariance structure (hence a known density function) that I would like to compare in order to get an intersect that tells me something about "how different" these distributions are (as t-statistics for univariate distributions). In order to visualize what I mean hear a little
2008 Mar 27
2
options in 'rnorm' to set the lower bound of normal distribution to 0 ?
Dear list, I have a dataset containing values obtained from two different instruments (x and y). I want to generate 5 samples from normal distribution for each instrument based on their means and standard deviations. The problem is values from both instruments are non-negative, so if using rnorm I would get some negative values. Is there any options to determine the lower bound of normal
2013 May 29
3
bootstrap
Hi, You might need to check library(boot).? I have never used that before.? So, I can't comment much.? It is better to post on R-help list.? I had seen your postings on Nabble in the past.? Unfortunately those postings were not accepted in R-help.? You have to directly post at ? r-help at r-project.org after registering at: https://stat.ethz.ch/mailman/listinfo/r-help ?
2017 Jul 19
2
spaghetti plot - urgent
Hi everyone, I?m trying to do a spaghetti plot and I know I?m doing all wrong, It must be. What I need: 15 subjects, each with measurements over 5 different times (t1, ..., t5), and the variable that I need to represent in the spaguetti plot is given by: PCR = b0 + b1 * ti + epsilon B0, - baseline of each subject B1 - trajectory of each subject over time (so multiply by t) Epsilon - error
2011 Jan 17
1
Problem about for loop
Hi everyones, my function like; e <- rnorm(n=50, mean=0, sd=sqrt(0.5625)) x0 <- c(rep(1,50)) x1 <- rnorm(n=50,mean=2,sd=1) x2 <- rnorm(n=50,mean=2,sd=1) x3 <- rnorm(n=50,mean=2,sd=1) x4 <- rnorm(n=50,mean=2,sd=1) y <- 1+ 2*x1+4*x2+3*x3+2*x4+e x2[1] = 10 #influential observarion y[1] = 10 #influential observarion data.x <- matrix(c(x0,x1,x2,x3,x4),ncol=5) data.y
2012 Sep 13
1
problem creating an array
Hello, I am having trouble creating a (1000,3,201) array in R from a data set created within the same script. My problem is that I want to take a matrix that is 1000x603 (called "landmat") and separate this into 201 separate (1000x3) matrices. My problem is when I try to do particular combinations of the columns. I want to take the first 3 columns of "landmat" and create