Displaying 20 results from an estimated 2000 matches similar to: "using a package function inside another function"
2006 Jul 21
1
insert insertRow?
Dear all,
In the search for a command to insert a row between other rows in a data
frame I found that there seems to be no such command in the base R
package. There is however a very simple function insertRow in the
micEcon package, that makes use of rbind. I wondered if it would not be
possible to include the following micEcon functions in the base package:
insertRow
insertCol
Since the
2006 Jul 21
1
insert insertRow?
Dear all,
In the search for a command to insert a row between other rows in a data
frame I found that there seems to be no such command in the base R
package. There is however a very simple function insertRow in the
micEcon package, that makes use of rbind. I wondered if it would not be
possible to include the following micEcon functions in the base package:
insertRow
insertCol
Since the
2010 Oct 13
2
adding a named column to a Matrix
Hello all,
I am trying to use cbind to add a named empty column to a Matrix:
outputmatrix <- cbind(outputmatrix,kog_id = seq(0,0,0))
The problem I have is that kog_id is a variable that has a value e.g.
"KOG1234", but I when I try to use this to name the added column, it
is named literally "kog_id" instead of "KOG1234".
How can I name a column by passing in a
2009 Dec 28
0
micEcon split into miscTools, micEconAids, and micEcon
The "micEcon" package has been split into three packages: miscTools,
micEconAids, and micEcon.
a) miscTools (version 0.6-0) includes miscellaneous small tools and
utilities that are not related to (micro)economics, e.g. colMedians(),
rowMedians(), insertCol(), insertRow(), vecli(), symMatrix(),
triang(), semidefiniteness(), compPlot(), and rSquared(). The
miscTools package should depend
2009 Dec 28
0
micEcon split into miscTools, micEconAids, and micEcon
The "micEcon" package has been split into three packages: miscTools,
micEconAids, and micEcon.
a) miscTools (version 0.6-0) includes miscellaneous small tools and
utilities that are not related to (micro)economics, e.g. colMedians(),
rowMedians(), insertCol(), insertRow(), vecli(), symMatrix(),
triang(), semidefiniteness(), compPlot(), and rSquared(). The
miscTools package should depend
2011 Apr 18
2
Predicting with a principal component regression model: "non-conformable arguments" error
Hello all,
I have generated a principal components regression model using the pcr()
function from the PLS package (R version 2.12.0). I am getting a
"non-conformable arguments" error when I try to use the predict() function
on new data, but only when I try to read in the new data from a separate
file.
More specifically, when my data looks like this
#########training data
2007 Oct 30
2
Splitting up the micEcon package?
Dear R Users:
The functions of our "micEcon" package [1,2] can be subdivided into three
categories:
- microeconomic demand and firm models
- sample selection models (mainly selection())
- routines for (likelihood) maximisation (e.g. maxLik(), maxNR(), maxBHHH())
(mainly used for ML estimation of sample selection models)
Although sample selection models are often used in
2011 Apr 04
1
simulating a VARXls model using dse
Hello,
Using the dse package I have estimated a VAR model using estVARXls().
I can perform forecasts using forecast() with no problems, but when I
try to use simulate() with the same model, I get the following error:
Error in diag(Cov, p) :
'nrow' or 'ncol' cannot be specified when 'x' is a matrix
Can anyone shed some light on the meaning of this error? How can I
2007 Oct 17
1
R CMD build and et_EE.UTF-8 locale -> invalid files (PR#10351)
Full_Name: Ott Toomet
Version: 2.6.0, 2.5.x
OS: debian etch, lenny
Submission from: (NULL) (80.235.63.243)
When building a package with 'R CMD build name_of_directory" using "et_EE.UTF-8"
locale, I get the following:
siim at tancredi:~/tyyq/econ/micEcon$ R CMD build trunk
* checking for file 'trunk/DESCRIPTION' ... OK
* preparing 'trunk':
* checking
2007 Apr 09
1
R:Maximum likelihood estimation using BHHH and BFGS
Dear R users,
I am new to R. I would like to find *maximum likelihood estimators for psi
and alpha* based on the following *log likelihood function*, c is
consumption data comprising 148 entries:
fn<-function(c,psi,alpha)
{
s1<-sum(for(i in 1:n){(c[i]-(psi^(-1/alpha)*(lag(c[i],-1))))^2*
(lag(c[i],-1)^((-2)*(alpha+1))
)});
s2<- sum(for(m in 1:n){log(lag(c[m],-1)^(((2)*alpha)+2))});
2008 Oct 21
2
Inserting a new row in a matrix
Hi guys,
I need to insert a row to a matrix in a for loop. I have matrix named "Avg"
which is a 5x4 matrix of zeros.
I have a file named "A"(4 rows,14 columns) which I make a sample of it 5
times. each time I get the mean for each column and put the result in the
"Avg" matrix. this is my code:
Avg=matrix(0,5,4)
>
> for(i in 1:5){
+ res=(A[sample(nrow(A),
2011 Apr 14
1
saving a regression model to a file
Hello all,
First off, I am using R version 2.13.0 in Ubuntu.
I have read previous posts in the R mailing list on saving models for
later use, and the responses indicate using the R save() function to
save a model and then using load() to load it is one way to go.
However, when I use the save() function to save a model to a file, and
then try to load it using load(), the loaded "model"
2008 Jul 16
1
Checking package vignettes: WARNING
Hi,
I want to have a "vignette" in one of my R packages. Hence, I added an Sweave
file into the /inst/doc subdirectory of this package. Unfortunately, 'R CMD
check' gives a warning:
==========================================
[...]
* checking tests ... OK
* checking package vignettes in 'inst/doc' ... WARNING
--- f?hre texi2dvi auf Vignetten aus
* creating
2008 Nov 06
2
How to return individual equation from {aidsEst} in package [micEcon]?
Hi, R core team
I am using the function {aidsEst} in package [micEcon] to do an AIDS
model now. So far, everything is good. But I want to test the auto
correlation and heteroskedasticity of the individual equation from AIDS
demand system. How can I return the individual equation?
PS: serial correlation test is {bgtest} in package [lmtest] and
heteroskedasticity is {bptest} in package
2005 Aug 16
1
Fwd: Documenting data sets with many variables
Hi,
since nobody answered to my first message, I try to explain my problem more
clearly and more general this time:
I have a data set in my R package "micEcon", which has many variables (82).
Therefore, I would like to avoid to describe all variables in the "\format"
section of the documentation (.Rd file). However, doing this lets "R CMD
check" complain about
2005 Apr 20
2
heckit / tobit estimation
Dear All,
we (Ott Toomet and I) would like to add functions for maximum likelihood (ML)
estimations of generalized tobit models of type 2 and type 5 (*see below) in
my R package for microeconomic analysis "micEcon". So far we have called
these functions "tobit2( )" and "tobit5( )".
Are these classifications well known? How are these functions called in other
2008 Jan 22
3
dynamic table/adding rows in IE using 'new Element("tr")'
I''m trying to create a few menus using prototype.js "insert" function.
I create a table using ''new Element("table")'', insert it in DIV and
then add links - one row per link (or the other way round - create a
full table, then insert it).
I initially wrote a code that worked fine in Firefox, but did not in
IE (currently testing with 6.0):
function
2006 Feb 17
1
Heckman regression / adjustment for standard errors?
Hello folks,
I am trying to estimate the two-step Heckman regression model. I would like to make an adjustment for intragroup correlations. Stata can implement this with the "cluster" option, but I am really hoping to stick with R. It seems that the micEcon package is the primary source for this two-step regression model (i.e., heckit), but I can't find a way to make the
2006 Nov 30
2
AIC for heckit
Hi,
I have used the heckit function in micEcon. Now I
would like to evaluate the fit of the probit part of
the model but when I enter
AIC(sk$probit)
I get this error
Error in logLik(object) : no applicable method for
"logLik"
How can I then get the AIC for this model?
Side question: If you know - from the top of your
head - some link to readings dealing with evaluating
the
2012 Sep 07
2
creating a symmetric matrix
Dear R People:
Suppose I have the following:
x <- 1:4
And I want to create the following matrix:
1 2 3 4
2 1 2 3
3 2 1 2
4 3 2 1
Is there a function in place for this, please? I looked at symMatrix
in micEcon and some of the items in Matrix, but they didn't quite do
it.
I can put together something quickly, of course, but it seems likely
that this would exist.
Thanks,
Erin
--