Thanks Andy, Alberto, Charles, Paul and Pierre. I needed to simulate a set of
counts to test a poisson regression model. Therefore would the best option be
as pointed use rpois(.,.)?
Sincerely
Anup
-
[[alternative HTML version deleted]]
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 -
Hi lalitha,
You can try this way. I think it should solve the problem.
Data looks like this
YX1
1 1
2 1
3 0
4 1
5 1
6 1
anal.data - read.table(file.txt, header=T)\
attach(anal.data)
## objective is to change the value 1 in column X1 to Gamma
Dear Friends,
I'm trying to generate a sequence of 100 observations
with either a 1 or -1. In other words the sequence
should look something like this.
y = 1 1 -1 1 -1 -1 -1 1 1 ..
Can somebody please give me some direction on how I
can do this in R.
Thanks
Anup
Dear Friends,
Is there a direct way to extract the marginal effects when running discrete
choice models such as Probit or Logit using glm?
Thanks and Regards
Anup
-
Ahhh...imagining that irresistible new car smell?
[[alternative HTML version
Dear Friends,
I have data set with around 220,000 rows and 17 columns. One of the columns is
an id variable which is grouped from 1000 through 9000. I need to perform the
following operations.
1) Remove all the observations with id's between 6000 and 6999
I tried using this method.
remdat1
Dear Friends,
I'm trying to learn to how to get Bootstrapped standard errors for estimated
coefficients from a regression.
For instance suppose I have the following model
logitmodel - glm (y~X1+X2+X3, family=binomial(link=logit))
beta - logitmodel$coef
can somebody please guide me on how to
Dear Friends,
My problem is related to how to measure probabilities from a probit model by
changing one independent variable keeping the others constant.
A simple toy example is like this
Range for my variables is defined as follows
y=0 or 1, x1 = -10 to 10, x2=-40 to 100, x3 = -5 to 5
hi jessica,
this should possibly do it...
year -
as.data.frame(c(2000-10-03,2000-10-03,2000-10-03,2000-10-03,2000-10-03,2000-10-03
,2000-10-03,2000-10-04,2000-10-04,2000-10-04))
colnames(year) - c(year)
time -
as.data.frame(c(14:00:00,14:10:00,14:20:00,15:30:00,16:40:00,16:50:00,
oops error on my part...forgot that we need to get the day and hour out of the
string...
[EMAIL PROTECTED] wrote:
Dear all,
I have a list of precipitation record and a list of time
I would like to sum them up per hour, or per day.
Does such a function exist ?
example:
time-c(2000-10-03
Dear Friends,
Is there an R package which implements regression
models with error distributions following a scale
mixture of normals?
Thanks
Anup
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Dear Friends,
I have some data with three columns named ID, Year and Measure X. I need to
create a column which gives me a lag for each ID (note not a continous lag),
but a lag conditional on the id and the given year. Please find below a sample
of the data
Input file sample
ID Year
Dear friends,
I'm writing a function with three arguments
myfun - function(theta, X, values)
{
}
in this function, I'm trying to write consistency checks. In order to compute
the statistic of interest I only need theta and values. The idea of having X in
there is that, if values is
Dear friends,
I was trying to read the source code for rlogis but ran into a roadblock. It
shows
[[1]]
function (n, location = 0, scale = 1)
.Internal(rlogis(n, location, scale))
environment: namespace:stats
Is is possible to access the source code for the same.
Sincerely
Anup
Dear Friends,
I was wondering if there is any package to get random numbers from the Burr 10
distribution. I checked the rmutil and actuar package. Both seems to implement
the Burr 12 distribution.
thanks in advance
Regards
Anup
-
Dear Friends,
Suppose I have a vector as follows
RI Value
1 10
2 11
3 8
4 4
6 12
I would like a function which returns therow index number for the minimum
value of VALUE. Can somebody please give me some direction on how I can do
this. In effect I'm trying to find a
Friends,
I'm trying to pass an equation as an argument to a function. The idea is as
follows. Let us say i write an independent function
Ideal Situation:
ifunc - function(x)
{
return((x*x)-2)
}
mainfunc - function(a,b)
{
evala - ifunc(a)
evalb - ifunc(b)
if (evalaevalb){return(evala)}
else
Dear Friends,
I have been trying to learn how to use the derivative free optimization
algorithms implemented in the package RGENOUD by Mebane and Sekhon. However, it
does not seem to work for reasons best described as my total ignorance. If
anybody has experience using this package, it would
Dear Friends,
I'm trying to find if there is a way to automate creation of the design matrix.
Suppose we are interested in say running an autoregressive model. The user
inputs the following data
myfunAR - function(y, order)
{.
..
}
now here y is the data series and order represents
Dear Friends,
I have a matrix of size 5000 X 20. The first two columns are indicator
variables taking the value of either 0 or 1. Let us call the first two columns
Y1 and Y2.
I need to randomly sample 1000 rows with all the associated columns, in other
words my new matrix should be of size
Dear friends,
I'm looking for a function which solves the system of equations Ax=B where A is
a positive definite banded matrix. I know that the command solve can be used to
arrive at a solution. But does it work as well with banded matrices?
In GAUSS the command bandsolpd achieves this. So
Hi Kris,
You just need to understand the mathematics of the incomplete gamma function
and the various relationships it has. The answers from both Mathematica and R
are correct, except that they are giving you different estimated quantities. It
depends on the way the gamma function is
Dear friends,
I have a data set with 23 columns and 38000 rows. It is a panel running from
the years 1991 through 2005. I want to aggregate the data and get the medians
of each of the 23 columns for each of the years. In other words my output
should be like this
Year Median
1991
Dear Friends,
I forgot to add, the idea is to aggregate the entire dataset based on year and
get the median value for each of the columns. Hence the output should be like
this
YearX1 X2X3 ...
1991102030...
199230 2010...
1993
24 matches
Mail list logo