Displaying 20 results from an estimated 40000 matches similar to: "is there an inverse method for table()?"
2010 Mar 08
2
fit a gamma pdf using Residual Sum-of-Squares
Hi all,
I would like to fit a gamma pdf to my data using the method of RSS (Residual Sum-of-Squares). Here are the data:
x <- c(86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174)
y <- c(2, 5, 10, 17, 26, 60, 94, 128, 137, 128, 77, 68, 65, 60, 51, 26, 17, 9, 5, 2, 3, 7, 3)
I have typed the following code, using nls method:
2010 Aug 17
2
Matrix
How do I completely remove the first column?
(x <- matrix(c(1, 44, 124, 80, 254, 70, 190, 0, 2, 35, 110, 70, 240, 73, 216, 0, 3, 41, 114, 80, 279, 68, 178, 0, 4, 31, 100, 80, 284, 68, 149, 0, 5, 61, 190, 110, 315, 68, 182, 1, 6, 61, 130, 88, 250, 70, 185, 0, 7, 44, 130, 94, 298, 68, 161, 0, 8, 58, 110, 74, 384, 67, 175, 0, 9, 52, 120, 80, 310, 66, 144, 0, 10, 52, 120, 80, 337, 67, 130, 0, 11,
2013 Jan 03
2
Sas by function in R
Hello,
It's an alternative to use SAS by function in R?
I want to plot d histograms by plot.from example bellow:
Thank you!
plot d
1 1 16.3
2 1 25.0
3 1 57.8
4 1 17.0
5 2 10.8
13 2 96.4
17 3 76.0
18 3 32.0
19 3 11.0
20 3 11.0
24 3 106.0
25 3 12.5
21 4 19.3
22 4 12.0
26 4 15.0
27 5 99.3
32 7 11.0
36
2013 Nov 26
7
[PATCH RESEND 0/1] libxl: introduce an option for disabling the non-O_DIRECT
I think I posted this patch before, but it looks like it was in
December 2012 (!).
1/1 libxl: introduce an option for disabling the non-O_DIRECT workaround
Ideally it would go into 4.4, at least. Provided the corresponding
qemu part has gone into qemu-xen, which I think it has. Can anyone
confirm ?
2009 Oct 20
2
descriptive statistics qn
This is day one on R for me, I am trying to figure out how to do simple
computations. For example I have a data set with 200 observations. I am
trying to compute the mean and variance in r for 1:25 (first 25
observations); 1:50 (first 50 obs) ; 1:100th observation etc. Here is the
dataset:
Id value
1 2.2338
2 3.13597
3 1.98685
4 4.35593
5 2.43963
6 4.20262
7 3.12131
8 4.79583
9 3.13937
10
2007 Mar 28
5
Large matrix into a vector
Hi,
I have a matrix HR(9x27). I would like to make a
single vector with elements: t(HR[,1]) followed by
t(HR[,2]) and then t(HR[,3] ... etc. Is there any neat
way of converting this matrix into a vector rather
doing something like c(t(HR[,1]), t(HR[,2]), t(HR[,3])
..)?
Thanks in Advance.
Kind regards,
Ezhil
____________________________________________________________________________________
2007 Oct 03
1
Reimplement order somehow
Hello,
I have a script in R language that makes sorting using the order() method of
R language. What I need is to reimplement this method in any other language
(PHP, Perl, Python, Java maybe).
First I tried to reimplement it in php, here is some numbers that i need to
sort:
1,2,3,4,5,6,7,8,9,10,300,231,11,12,0,1
R language:
n = c(1,2,3,4,5,6,7,8,9,10,300,231,11,12,0,1)
n
[1] 1 2 3 4 5
2013 Feb 27
2
matrix multiplication
Hi,
Try this:
#mat1 is the data
res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2009 Jan 24
1
Environment change?
So i have a simple question that doesnt require sample code, not sure if that
violates posting rules or not.
Is this:
[1] "111" "112" "113" "114" "115" "116" "118" "119" "120" "123" "125" "126"
[13] "127" "128" "132" "137"
2010 Sep 14
3
how to compute when row length is different
hi guys..please help me with this
i am working on two data frames
one goes like this:
DF1
Sample_id RepairHours Denatured Dose ZeroMean FourtyFiveMean NinetyMean
1 SDM071 0 1 B 60.5 19.0 45.0
2 SDM071 1 1 B 46.0 23.0 42.5
3 SDM071 2 1 B 52.5 24.0 40.0
4 SDM071
2009 Dec 26
2
input a list into a function
I want to input a list into a function. But i get the error "Error in +{ : invalid argument to unary operator". How do I avoid this error?
Here is an example of this problem:
> g = c(2, 4, 8, 16, 32, 64, 128, 122, 110, 86, 38, 76, 18, 36, 72, 10, 20, 40, 80, 26)
> for (i in 1:20)
+ {for (x in 0:20)
+ print(g[i]+x)}
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
2009 May 31
2
convert the contents of a date.frame to a matrix
Dear R user,
I am trying to convert the contents of a date.frame to a matrix. Since there
are negative values in the date.frame, when I use data.matrix(x,
rownames.force = NA), the resulting matrix is not the same as the original
one. Basically I think R treats the numbers in the date.frame as character
and converts it to corresponding numerics.
Any idea on this issue?
Many Thanks,
Hongyuan
2009 Mar 11
2
Question about datatypes/plotting issue
Hi,
I am trying to plot the Case-Shiller index found at: http://www2.standardandpoors.com/spf/pdf/index/CSHomePrice_History_022445.xls
The way I'm importing it into R is as follows:
library(gdata)
W <- read.xls("http://www2.standardandpoors.com/spf/pdf/index/CSHomePrice_History_022445.xls
", header=TRUE)
attach(W)
To give you and idea of what the data looks like:
>
2012 Mar 26
4
reading header in txt file and making histogram
Dear all
I am a BEGINNER and have R on my Mac. I saved my excel file as .txt file, I
have just one column with first row as the column name. My file when read by
R looks like this. After reading the table I try to make a histogram by
hist(dbh), it says object dbh not found. What am I doing wrong? thanks
dbh
1 11.53
2 16.05
3 7.36
4 16.05
5 8.66
6 12.74
7 22.93
8 7.55
9
2001 Aug 26
1
Display of 3d arrays
Hi!
Is it possible to display a 3d array as
an RGB image? For example, given the following
array:
> matriz3d
, , 1
[,1] [,2] [,3] [,4] [,5]
[1,] 170 174 173 172 161
[2,] 171 178 174 166 149
[3,] 168 174 173 166 156
[4,] 171 170 173 166 164
[5,] 167 170 170 171 169
, , 2
[,1] [,2] [,3] [,4] [,5]
[1,] 138 131 128 128 125
[2,] 138 127 129 122 134
2009 Apr 14
4
cbind
I have a list of numbers with NAs as below:
> A[,1]
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[19] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[37] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[55] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA
[73] NA NA NA 62 78 98
2012 Mar 28
1
CI with confint
Hello all,
I'm trying to use confint from the MASS package to compute confidence
intervals for an nls object. When I plot the results, however, they don't
make sense - lines cross over the fitted model or just don't match the
data. Code is :
Thanks for help
dat<-data.frame(a,b)
with(dat, plot(a,b))
model<-(nls(b~(1/exp(a*x))*n, data=dat, start=list(x=.001,n=20),
2017 Mar 23
2
ayuda
Etimados
Necesito llevar estos valores a un csv, pero exclyendo los numeros de
orden que aparecen (como ejemplo 1 2 3 4 5
6 7... 146 147 148 149 )
?cual es el procedimiento en R?
saludos
José
adjunto el archivo
1 2 3 4 5 6 7 8
9 10
398.25016 314.53157
2005 Aug 19
1
How to create design matrix for LLMNL?
Hello,
I have a small problem with developing design matrix X, which I use in
estimation the log-likelihood of a multinomial logit model.
I have the data:
number of observation - 289
number of choice alternative- 3
number of choice specific variables in matrix X -4
matrix X =289x4
I tried to use the function createX, I know that I have to get design matrix
289x12 (am I right?) but
2012 Nov 30
2
missed values
Hello
I have dataframe
101 2008-07 0.2898966
102 2008-08 0.3101667
103 2008-09 0.3730476
104 2008-10 0.2717037
105 2008-11 0.1344286
106 2008-12 0.1375000
107 2009-01 0.1781000
108 2009-02 0.2146667
109 2009-03 0.2808235
110 2009-04 0.4326250
111 2009-05 0.3420741
112 2009-06 0.2675238
113 2009-07 0.2478667
114 2009-08 0.3147000
115 2009-09 0.3437826
116 2009-10 0.2057391
117 2009-11 0.1824737
118