Is there a way in maxLik to fix/constraint a parameter to fall within a certain
range ? For example
I want sigma to be always between 1.98 and 2.02
library(maxLik)
loglik <- function(param) {
mu <- param[1]
sigma <- param[2]
ll <- -0.5*N*log(2*pi) - N*log(sigma) - sum(0.5*(x -
mma(100,2,1)
x.boot <- boot(x, function(y,i) mean(y[i]), R=1000)
x.boot
hist(x.boot$t)
str(x.boot)
x.quant <- quantile(x.boot$t, p=c(0.025, 0.975))
x.quant
x.quant[1:2]
str(x.quant) Peter Maclean Department of Economics UDSM
#Create table/data frame
__
Is it possible to reproduce the eye-diagram described here from the topic model/
https://github.com/ouzor/eyediagram/blob/master/example.R
and shown here:
https://github.com/ouzor/eyediagram/blob/master/example/ExampleEyeDiagram.pdf
The code do not work in processing as suggested by the author
and a developed country.
Peter Maclean
Department of Economics
University of Dar-es-Salaam, Tanzania.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
] - strsplit(a[j],-)[[1]][1]
post[j] - strsplit(a[j],-)[[1]][2]
page[i] - paste0(pre[j], b[i],post[j])
}}Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
units. Is
there any package I have missed? I am currently doing a sequential analysis
comparing each treated unit to the 35 untreated units. I would like to get a
composite result. Any help will be appreciated.
Sincerely,
Peter Maclean
Department of Economics
UDSM
, main = )
palette(op)
abline(v=0, h=0) })
Peter Maclean
Department of Economics
UDSM
__
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
periods
during which the technology i starts to enter the saturation and decline phase,
respectively. Any suggestion, reading will be appreciate.
Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
and tc are time periods
during which the technology i starts to enter the saturation and decline phase,
respectively.
Any suggestion, reading is helpful.
Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
https
curves
Peter Maclean
Department of Economics
UDSM
__
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
- as.data.frame(rep(18, 9))
colnames(x4) - c(name)
dat - rbind.data.frame(x1, x2, x3, x4)
dat - as.data.frame(dat)
colnames(data) - c(name)
fix(dat)
require(ggplot2)
ggplot(dat , aes(x=name, y = ..density..)) +
geom_histogram(colour = darkgreen, fill = blue, binwidth = 0.5)
Peter Maclean
PCA(responses, scale.unit=TRUE, ncp=3, graph=T)
#How to conduct polychoric principal component analysis using either of #the
above package and producing individual and variable factor maps as #above
Peter Maclean
Department of Economics
UDSM
__
R-help
Do anyone now R packages that run/test stochastic dominance
with respect to a function (SDRF) and/or stochastic efficiency
with respect to a function (SERF)?
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R
not look good
#How do i remove the NaN or create a better one
prop.table(ftable(data1, exclude = c(NA, NaN)), 1)
prop.table(ftable(xtabs(~region + district+ response, data=data)),1)
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted
2=Widow
3=Others
Peter Maclean
Department of Economics
UDSM
On Sunday, October 27, 2013 3:32 AM, Barry Rowlingson
b.rowling...@lancaster.ac.uk wrote:
On Sat, Oct 26, 2013 at 9:37 PM, Peter Maclean pmaclean2...@yahoo.com wrote:
I do not have SPSS and I would
:760EÂ Â Â Â Â Â Â 8:06:040S
31:41:190EÂ Â Â Â Â Â 8:06:557S
31:41:229EÂ Â Â Â Â Â 8:06:622S
31:38:891EÂ Â Â Â Â Â 8:06:281S
I am using gmt package for
geocodes conversion.
I will appreciate any help.
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted
Anyone aware of a package or technique to import odf data file into R, I will
appreciate his/her help.
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch
- big.matrix(DistMatrix(data))
data2 - cbind(data, SWMD)
With thanks
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
#I Want to go back to step 1 to start over again
Sincerely,
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
)
Peter Maclean
Department of Economics
UDSM
[[alternative HTML 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
-verify-failed
http://stackoverflow.com/questions/7411215/oauth-authentication-with-twitter-api-failed
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch
in this subjet (including creating weights
from strata and sampling unit variables) will be helpful. For example if
analyzing data clustered in schools, how to use student's sampling weight or
school sampling weight or both?
Peter Maclean
Department of Economics
UDSM
[[alternative
)) )
dev.off()#The actual data have more than 5 thousand data points, Just want to
plot a few
#selected randomly. Also, if I can put 5 data points (nearest grids) in one
graph
#will be more helpful.
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted
= c(l, l,p), ylim=c(min, max),
layout=c(1,4))
dev.off()
##
#I want to remove the lat and lon rows and put the numbers inside the graph
Peter Maclean
Department of Economics
UDSM
for (dirname in dirs) {
fdownload(dirname)
}
}
# Call the function
fdownload(ftp://ftp.root/)
##
I could not find any solution from the web.
I will appreciate any help
Peter Maclean
Department of Economics
UDSM
[[alternative HTML
/fews/AFR_CLIM/ARC2/DATA/1985/;
filenames = getURL(url, ftp://ftp.use.epsv/ = FALSE, dirlistonly = TRUE)
crlf = TRUE
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https
.
library(RCurl)
# Download the files for 1985.
url = ftp://ftp.cpc.ncep.noaa.gov/fews/AFR_CLIM/ARC2/DATA/1985/;
filenames = getURL(url, ftp://ftp.use.epsv/ = FALSE, dirlistonly = TRUE)
crlf = TRUE
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted
by the SAS code.
Peter Maclean
Department of Economics
UDSM
[[alternative HTML 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
Is there a way of executing SAS codes in R environment?
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
10 1.6
4 2 12 1.2
5 3 4 1.8
6 3 6 1.6
7 4 2 1.8
df2
id age ind dose
1 1 4 1 1.8
2 2 5 1 1.8
3 2 10 2 1.6
4 2 12 3 1.2
5 3 4 1 1.8
6 3 6 2 1.6
7 4 2 1 1.8
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version
on TZA_adm2 polygon?
#Also how to remove the legent or putting the names in the map. auto.key=FALSE
does not work.
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https
(data, 3, kernel=list(type ='rectangular', shift=0),
distribution='Gamma', fit='max-lik', na.rm=FALSE))
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch
I am looking for study materisl on how to conduct 'small area estimation' using
structural equations models in R for both longtudinal and repeated
cross-section data. Tried google did not work. There are other regression
technique my interest is on structural equation models.
, spans = c(3,3), detrend=FALSE,log=no,plot = TRUE,
kernel(modified.daniell, c(5,7)))
plot(y.spc, plot.type = marginal, main=Smoothed Periodogram)
Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
https://stat.ethz.ch
How do I move the legend from default position (right and within the plot) to
the bottomleft of the plot?
interaction.plot(YEAR, ID GROWTH, legend=TRUE, col = 2:7,xlab=Year,
ylim=c(0,2), ylab=Growth,leg.bty = o)
Peter Maclean
Department of Economics
UDSM
I am looking for introductory/published papers on spectral analysis\Frequency
domain analysis for both univariate and multivariate Time Series data that use
R-preferabily climate or economic data. I have some but most of them are not
for begginers.
Peter Maclean
Department of Economics
UDSM
original data (temp rain) to new data
Peter Maclean
Department of Economics
UDSM
__
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
)
#Error in xts(coredata(x), order.by = order.by, frequency = frequency, :
# order.by requires an appropriate time-based object
Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
In glm() you can use the summary() function to recover the shape parameter (the
reciprocal of the dispersion parameter). How do you recover the scale
parameter? Also, in the given example, how I estimate and save the geometric
mean of the predicted values? For a simple model you can use
There is no missing value nor zero values.
- Original Message
From: Uwe Ligges lig...@statistik.tu-dortmund.de
To: Peter Maclean pmaclean2...@yahoo.com
Cc: r-help@r-project.org
Sent: Tue, July 12, 2011 2:58:10 AM
Subject: Re: [R] fitdistr() Error
Any NA values or values outside
I am trying to estimate a gamma function using real data and I am getting the
following error messages.
When I set a lower limit; the error message is L-BFGS-B needs finite values of
fn
For other method the error message is:
Error in optim(x = c(0.1052867, 0.3472275, 2.057625,
Is is possible to recover the return levels and intervals (as reported in a
turn
level plot) at a given confidence interval? See a repducible example.
#Grouped vector
n - data.frame(n = rep(c(1:3), each = 10))
y = rgamma(30, shape=0.5, rate = 1, scale = 10)
require(plyr)
require(ismev)
for Grouped
rg2- by(Gdata,Gdata[,n], function(x) gev(x$y, 5, method = BFGS, control
=list(maxit = 500)))
# rl - rlevel.gev(rg2, k.blocks = 5, add = TRUE)
- Original Message
From: Dr. Bernhard Pfaff bernh...@pfaffikus.de
To: Peter Maclean pmaclean2...@yahoo.com
Sent: Fri, June 3, 2011 2:45
, control =list(maxit = 1))
rlep- rlevel.gev(rle, k.blocks = 2, add = FALSE)
rlep
- Original Message
From: Dennis Murphy djmu...@gmail.com
To: Peter Maclean pmaclean2...@yahoo.com
Sent: Thu, June 30, 2011 3:03:05 PM
Subject: Re: [R] Saving fExtremes estimates and k-block return level
Dr. Pfaff:
After using str; can you give an example on data extration (e.g. for
$par.ests and @residuals)
- Original Message
From: Pfaff, Bernhard Dr. bernhard_pf...@fra.invesco.com
To: Peter Maclean pmaclean2...@yahoo.com; Dr. Bernhard Pfaff
bernh...@pfaffikus.de
Cc: r-help@r
I want to create columns from this row vector. From:
x1 x2 x3 x1 x2 x3 x1 x2 x3
1 2 3 1 2 3 1 2 3
to:
x1 x2 x3
1 2 3
1 2 3
1 2 3 Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
https
That is what I wanted
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Sarah Goslee sarah.gos...@gmail.com
To: Peter Maclean pmaclean2...@yahoo.com
Cc: r-help@r-project.org
Sent: Wed, July 6, 2011 1:15:31 PM
Subject: Re: [R] Split a row vector into columns
You
How to substring the following vector (in data frame b)
b
a
11
12
1234
1245
124567
126786
145769
such that:
a1 a2
1 1
1 2
12 23
12 34
124 567
126 787
145 769
I tried logical commands with substr() did not work out.
__
Peter,
Try
data.frame(n = names(res2), t(sapply(res2, function(l) l@fit$par.ests)))
for the first part.
HTH,
Jorge
On Thu, Jun 30, 2011 at 12:16 AM, Peter Maclean wrote:
I am estimating a large model by groups. How do you save the results and returns
the associated quantiles
Dennis:
It walks for small datset.
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Dennis Murphy djmu...@gmail.com
To: Peter Maclean pmaclean2...@yahoo.com
Cc: r-help@r-project.org
Sent: Mon, June 27, 2011 8:37:00 PM
Subject: Re: [R] BY GROUP IN GEV
HI:
Since
People with more experience in R I need help on this.
I would like to drop observation if they meet certain condition. In this
example
I would like to drop group 2 in n because the group in Y has more than 2
zeroes.
#Example
n - c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,3)
y -
I am estimating a large model by groups. How do you save the results
and returns
the associated quantiles?
For this example I need a data frame
n xi mubeta
1 0.1033614 2.5389580 0.9092611
2 0.3401922 0.5192882 1.5290615
3 0.5130798 0.5668308 1.2105666
I also want to
I tried this but did not work:
z0- by(z, z[,n], function(x) subset(x, sum(n==0)2))
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Duncan Murdoch murdoch.dun...@gmail.com
To: Peter Maclean pmaclean2...@yahoo.com
Cc: r-help@r-project.org
Sent: Wed, June 29, 2011 3
Hi Dennis:
I tried your suggestions and I am getting the following errors:
Error in x$CP1 : $ operator is invalid for atomic vectors
In addition: Warning message:
In sqrt(diag(varcov)) : NaNs produced
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Dennis Murphy
I am trying to run gev (general extreme value) function in “evir” package. My
data is divided by state. I am using the following codes but it is not working.
I will appreciate any help.
#Split data
MAS - split(MA, MA$states)
CP - lapply(MAS, function(x){gev(MAS$CP1, 100, method = BFGS,
55 matches
Mail list logo