ode, thus how do I get raw data
(object ab) from ddd?
I've tried
as.data.frame.table(ddd)
which is not the answer I'm looking for.
Thanks in advance,
PF
--
+---
| Patrizio Frederic,
| http://
[3,] "b" "A"
> [4,] "b" "A"
> [5,] "c" "A"
> [6,] "d" "A"
>
> -
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77
this is an off-topic, of course!
by definition, pdf MUST BE POSITIVE and log function is defined ONLY
for positive values.
check your pdf code and find out the errors.
regards
Patrizio Frederic
+-
| Patrizio Frederic
| Research associate in
x + eps
plot(x,y)
abline(lsfit(x,y))
abline(b0,b1,col=2)
regards
PF
ps notice that in heteroscedasticity case the random vector (X,Y) is
not a bivariate normal but it is:
Y|X=x ~ normal(b0+b1 x; h(x))
ie every conditional Y is normal
+-
| Patriz
dear Silvia,
quoting Venables WN and Ripley DB (1994) Modern Applied Statistics
with S-plus, sringer, pag 185:
"Since explicit expressions for the maximum likelihood estimators are
not usually available estimates MUST be calculate iteratively"
means that glm.fit performs MLE indirectly and effici
try this
colSums(matrix(x,8))
regards,
PF
+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51,
| 41100 Modena, Italy
|
| tel: +39 059 205 6727
| fax
try
?unlist
it may help
regards
+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51,
| 41100 Modena, Italy
|
| tel: +39 059 205 6727
| fax: +39 059
this works
cno = c(rep(1342,times=3),rep(2568,times=2))
rank= c(.23,.14,.56,.15,.89)
df1 = data.frame(cno,rank)[order(cno,rank),]
cnou= unique(cno)
ind = match(cno,cnou)
where = tapply(rank,ind,length)
where = cumsum(as.numeric(where))
df1[where,]
regards,
PF
2008/7
this works too:
n = 6 # number of rows
m = 4 # number of coloumns
nm = n*m
mat = matrix(1:nm,n) # your matrix
pf = function(Col){
ind = rep(1:(n/2),each=2)
out = tapply(Col,ind,prod)
out
}
# pf performs forall vecotr x: x[i]*x[i-1], i=2,4,6
advance,
Patrizio Frederic
+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51,
| 41100 Modena, Italy
|
| tel: +39 059 205 6727
| fax: +39 059 205 6947
# is that what you want?
table(cut(xy,seq(0,max(xy)+.4,by=.4)))
# or this
table(cut(xy,hist(xy)$breaks)) # not the same
regards,
PF
+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena
have a look at
http://sunsite.univie.ac.at/rcom/server/doc/RExcel.html
regards,
PF
2008/7/30 losemind <[EMAIL PROTECTED]>:
>
> Hi all,
>
> How do I operate R from within Excel?
>
> I mean, highlight a bunch of cells, and send to R, and do some statistics in
> R, and return back the numbers and
can you write the bimodal gamma pdf?
if so create your own pdf:
dbigamma=function(x,alpha1,alpha2,beta1,beta2)
{
# ... the bimodal gamma pdf (I can't find it)
}
hist(x,probability=T)
curve(dbigamma(x,alpha1,alpha2,beta1,beta2))
and look at the result
regards,
PF
2008/7/29 Gundala Viswanath <[
t in Italy to me for studing a new
topic).
Any suggestion is welcome.
Regards,
Patrizio Frederic
+-----
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario
?write.table
could help
PF
2008/7/31 Max <[EMAIL PROTECTED]>:
> Marc,
>
> this is very handy. My next question is, do you know a quick and easy way to
> transfer all of the output to a txt file? (or .xls)?
>
> Thanks,
>
> -Max
>
>
> Marc Schwartz explained on 07/31/2008 :
>>
>> on 07/31/2008 12:
system i386, mingw32
status
major 2
minor 7.1
year 2008
month 06
day23
svn rev45970
language R
version.string R version 2.7.1 (2008-06-23)
what's going wrong?
Thanks in advance,
Regards,
Patrizio Frederic
___
>> system i386, mingw32
>> status
>> major 2
>> minor 7.1
>> year 2008
>> month 06
>> day23
>> svn rev45970
>> language R
>> version.string R version 2.7.1 (2008-06-
Hi Zhang ,
take a look to sur package
http://www.systemfit.org/
regards,
Patrizio Frederic
+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51
iling list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
+-
| Patrizio Frederic, P
L version deleted]]
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
is message:
Error in load("K:\\.RData") :
ReadItem: unknown type 136, perhaps written by later version of R
I've no idea of what type 136 is. Any hints?
Thanks in advance,
Patrizio
--
+-----
| Patrizio Frederic, PhD
| Assistant P
Greg,
it seems an obvious behavior to me
y=c(2,2,2,3,3,3,1)
x=1:length(y)
plot(x,y)
lines(x,approxfun(x,y)(x)) # for every x it exists one only value of y
plot(y,x)
lines(sort(y),approxfun(y,x)(sort(y))) # for some y it exists more
than one value of x!
approxfun return a function. By definition
try also
m <- matrix( runif(5^2), nrow=5, dimnames = Names<- list(
c("A","B","C","D","E"),
c("O","P","Q","R","S") ) )
data.frame(expand.grid(Names[[1]],Names[[2]]),as.numeric(m))
data.frame(code=outer(Names[[1]],Names[[2]],paste,sep=".")[1:25],num=as.numeric(m))
Patrizio
2009/3/25 jim holtma
this works
which.is.not.unique <- apply(x,2,function(x)ifelse(length(unique(x))==1,F,T))
x[,which.is.not.unique]
patrizio
2009/3/26 Duijvesteijn, Naomi :
>
> Hi Readers,
>
>
> I have a question.
>
>
> I have a large dataset and want to throw away columns that have the same
> value in the
2009/3/27 huiming song :
> hi, everybody, please help me with this question:
>
> If I want to do iteration for 1000 times, however, for the 500th iteration,
> there is NaN appears. Then the iteration will stop. If I don't want the stop
> and want the all the 1000 iterations be done. What shall I do
or the exactly equivalent form:
x[x$X1 %in% unique(x[x$X2>0,"X1"]), ]
Patrizio
2009/4/2 Nutter, Benjamin :
> x <-
> data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),re
> p(1,2)),ncol=2))
>
> id.keep <- unique(subset(x,X2>0)$X1)
>
> x2 <- subset(x,X1 %in% id.keep)
>
> x2
>
>
dear all,
I'm a newbie in map tools. I was asking to perform an apparently very
simple task.
I have a list of countries (about fifty all over in the world) scored
with a real positive value. Eg
Country score
Italy .56
UK .58
Korea .41
Mexico .63
...
I wish to plot geographical maps wher
Roger,
many thanks for your very useful suggestions.
I've just produced some plot using xlim/ylim. I noticed I can only
zoom in a square box. Is there any way to produce rectangular ones?
Best
Patrizio
2009/4/7 Roger Bivand :
> Patrizio Frederic gmail.com> writes:
>
>>
&
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
+---
as.numeric(a) # whoops, won't work
class(as.matrix(a)) # change class, and
as.numeric(as.matrix(a)) # bingo, it works
PF
--
+--
(x)class(x))
class_a
a_numeric <- a[,class_a=='numeric']
as.numeric(as.matrix(a_numeric))
Regards,
PF
--
+---
| Patrizio Frederic,
| http://www.economia.unimore.it/frederic_patrizio/
+--
terally, as.numeric: transforms in numbers
b # look at b
class(b) # which is now a numeric matrix
best regards
PF
--
+---
| Patr
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
+-----
| Patrizio Frederic, PhD
| Assistant Professor,
| Department of Economics,
| Un
ave posA as the same
> data.frame than Pos100415.
>
> Any help?
>
> TY
>
> ______
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
apologize for my fragmented English
--
+-----
| Patrizio Frederic, PhD
| Assistant Professor,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51,
| 41100 Modena, Italy
|
| tel: +39 059 205 6727
| fax: +39 059 205 6
ms proposed for computing such a task.
>>
>> I was wondered if some of you knows about some R implementations
>> (packages) for computing BSA.
>>
>> Many thanks in advance,
>>
>> Patrizio
>>
>> as usual I apologize for my fragmented English
>
Hi Danny,
it sounds to much easer than that.
Try
y <- data.frame(matrix(rnorm(100),10))
nr <- ncol(y)
test <- lapply(y, shapiro.test)
sapply(test,function(x)c(x$statistic, x$p.value))
it should perform the required task.
Cheers,
P
On Fri, Feb 4, 2011 at 4:52 AM, DB1984 wrote:
>
> This is my
dear all,
here's a couple of questions that puzzled me in these last hours:
# issue 1 qnorm(1-10e-100)!=qnorm(10e-100)
qnorm(1-1e-10) == -qnorm(1e-10)
# turns on to be FALSE. Ok I'm not a computer scientist but,
# but I had a look at the R inferno so I write:
all.equal(qnorm(1-1e-10) , -qno
message and notify
> us by collect call immediately. Thank you.
>
> [[alternative HTML version deleted]]
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read
__
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
+---
mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal
xseq, if (plot.type == "curves") 100 else 40, :
variable blood.pressure does not have limits defined by datadist
I guess somthing goes wrong with function datadist
> version
_
platform i386-pc-mingw32
arch i386
os
chine.
Thank in advance.
Patrizio Frederic
version
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 7.0
year 2008
month 04
day22
svn rev45424
language R
version
2008/5/29 Frank E Harrell Jr <[EMAIL PROTECTED]>:
> Patrizio Frederic wrote:
>>
>> dear Harrell,
>> thank you for quick reply and suggestions. I still have the problem:
>>
>> library(Design)
>> x = rnorm(100)
>> y = runif(100)<(exp
.Options created by
options().
Now everything is fixed. Now I know how .Options and options are
related one each other. Sorry for wasting your time.
Thank you for your help.
Patrizio Frederic
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mai
Dear all,
is there any way to transform a .Data directory created in S-plus 6.1
for windows in a .RData file?
Thanks in advance,
Patrizio Frederic
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
hey Kirsten,
did type
?axis
it may help. eg:
plot(rnorm(100),axes=F)
axis(1)
axis(3,at=seq(0,50,length=3),labels=c("A","B","C"))
axis(2)
axis(4,at=seq(-2,2,length=10),labels=1:10)
Best,
Patrizio
2009/1/14 Kirsten Thonicke :
> Dear R experts,
> I want to plot a line chart with another second
hey Joe,
I had a quick look at your code. In this line:
b2$PRRSvac <- ifelse(b2$status=="MS-X, PRRS-pos"|b2$status=="R�d
SPF+Myc+Ap2+DK+Vac",1,0)
some special characters are used. You must use only plain ascii characters
Hope this help.
Cheers,
Patrizio
2009/2/13 joe1985 :
>
> Hello
>
> I want
do you mean:
f=function(x)
0*(abs(x-.5)<=.3)-1*(abs(x-.5)>=.4)+(10*x-2)*(x>.1&x<.2)+(-10*x+8)*(x>=.2&x<=.5)
f(x)
curve(f,0,1)
hope it helps.
Patrizio
2009/2/14 kathie :
>
> Dear R users,
>
> >From the code below, I try to compute "y" value. (In fact, y looks like a
> trapezoid)
>
>
James,
you're probably interested in image function rather than in
filled.contour. Type ?image to see the syntax.
Cheers,
Patrizio
2009/2/18 James Nicolson :
> Hi,
>
> Thanks for your help. I have looked at the beginners documentation and
> while there are options to configure various aspects of
James,
as I previously told you in my broken English, probably the function
you're looking for is not filled.contour but image and contour
The following code makes exactly what you ask for
data(akima)
akima
akima.smooth <-
with(akima, interp(x, y, z, xo=seq(0,25, length=500),
hey Laura,
I hope this help
f1 = c("a","b","c")
f2 = c("b","a","c","d")
match(f2,f1)
f3 = match(f2,f1,0)
?match
cbind(f2,f3)
cbind(f2,f3>0)
f4 = ifelse(f3>0,"yes","no")
cbind(f2,f4)
data.frame(f2,f4)
Patrizio
2009/2/25 Laura Rodriguez Murillo :
> Hi dear list,
>
> If anybody could help me, it wo
Jason,
be carefully to the order of intensities (counts or densities):
x=rnorm(1000)
par(mfrow=c(2,2))
h=hist(x,breaks=bk<-c(-5,-3,-2,-1,-.5,0,1,3,5))
barplot(rev(h$intensities),rev(bk[2:9]-bk[1:8]),space=0,horiz=T) # compare to
axis(2)
barplot(h$intensities,bk[2:9]-bk[1:8],space=0,horiz=T)
axis(2
Hi Agus,
try this two ones
d<-matrix(rpois(45,3),5,9)
barplot(d,beside=T,col=rainbow(5),names=c("CRTL","LSB","ONEMKR",
"TWOMKR","BLUP","BLUPQ","BLUP1M","BLUP2M","GAS"),las=2)
barplot(d,beside=T,col=rainbow(5),names=c("CRTL","LSB","ONEMKR",
"TWOMKR","BLUP","BLUPQ","BLUP1M","BLUP2M","GAS"),cex.nam
"blue" NA
3 "3" "blue" "1.1"
# and if I sapply, I loose factors labels
> sapply(data,choose.last)
V1 V2 V3
1 1 3 0.4
2 2 1 NA
3 3 1 1.1
any hint?
Thanks in advance,
Patrizio
+-
| Patrizio Fre
dear Hadley and Bert,
thank you very much for your suggestions. I asked one question and I
learned 2 things:
1. Hadley,
library(plyr)
ddply(data, .(V1), colwise(cl))
that is exactly what I was searching for.
2. Bert,
> ?tapply says that the first argument is an **atomic** vector. A
> factor is
56 matches
Mail list logo