Displaying 20 results from an estimated 300 matches similar to: "R formula"
2012 Oct 28
6
Hausman test in R
Hi there,
I am really new to statistics in R and statistics itself as well.
My situation: I ran a lot of OLS regressions with different independent
variables. (using the lm() function).
After having done that, I know there is endogeneity due to omitted
variables. (or perhaps due to any other reasons).
And here comes the Hausman test. I know this test is used to identify
endogeneity.
But what I
2007 May 23
0
Changing sequential regression code to call systemfit
I use code ( actually its code from vars package and its directly below
) to do a sequence of lm calls and the data I use from the matrix
depends on restrictions.
for(i in 1:K){
datares <- datasub[, which(x$restrictions[i, ] == 1),drop=FALSE]
y <- yendog[, i]
lmres <- lm(y ~ -1 + ., data=datares)
# x$varresult[[i]] <- lmres
# x$resid[, i] <-
2009 May 29
1
Error messages/systemfit package
Hello !
I’m trying to estimate a system of equation (demand and supply) using the systemfit package. My program is:
library(systemfit)
demand <- tsyud ~ tsyud1 + tsucp + tspo + tssn
supply <- tscn ~ tsyn + tsqn + tsksn + tsucp
system <- list(demand=eqdemand, learning = eqsupply)
labels <- list(demand="eqdemand", learning="eqsupply")
inst <- ~ tsupp1 + tsupp2
2007 May 23
1
I made some progress on my previous "systemfit" question but still not quite there
Surprisingly, I played around with some test code and below actually
creates equations that look correct.
tempmat<-matrix(10,nrow=6,ncol=6)
restrictmat<-diag(6)
colnames(tempmat)<-c("AUD.l1","CHF.l1","CAD.l1","GBP.l1","EUR.l1","JPY.l
1")
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
Hi everyone,
I am looking to do some manual maximum likelihood estimation in R. I
have done a lot of work in Stata and so I have been using output
comparisons to get a handle on what is happening.
I estimated a simple linear model in R with lm() and also my own
maximum likelihood program. I then compared the output with Stata.
Two things jumped out at me.
Firstly, in Stata my coefficient
2004 Nov 29
3
systemfit - SUR
Hello to everyone,
I have 2 problems and would be very pleased if anyone can help me:
1) When I use the package "systemfit" for SUR regressions, I get two
different variance-covariance matrices when I firstly do the SUR
regression ("The covariance matrix of the residuals used for
estimation") and secondly do the OLS regressions. In the manual for
"systemfit" on page
2011 Jun 28
2
How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work
Greetings R Users,
I have a system of equations for which I would like to output all the
R-squares. Assume there are four equations in my system, the only way I
found to output all the R-squares is by calling them out one by one as this:
summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared
But isn't there a
2005 Dec 02
3
masked from package:base?
I am confused by the following description in
http://www.maths.lth.se/help/R/.R/library/systemfit/html/hausman.systemfit.html
what does the "Not run" mean? if we do not load systemfit, how can we run
the following code?
## Not run: library( systemfit )
data( kmenta )
attach( kmenta )
...
I install the package of systemfit, and run the code.
I got the warning:
> library( systemfit
2005 May 25
3
Problem with systemfit 0.7-3 and transformed variables
The 'systemfit' function in systemfit 0.7-3 CRAN package seems to have a
problem with formulas that contain transformed (eg. log) variables. If I
have my data in a data frame, apparently systemfit doesn't "pass" the
information of where the variables should be taken to the transforming function.
I'm not entirely sure if this is a bug or just a limitation, I was just
2010 Sep 03
1
How to use lm() output for systemfit() 'Seemingly unrelated regression'
I am having problem using output of lm() function for further analysing using
systemfit package.
Basicaly, the problem s following - I generate several formulas using lm()
> fo1 <- lm(r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43])
> fo2 <- lm(r98[,1] ~ f98[,1] + f98[,2] + ... + f98[,43])
and than I want to estimate a general model using package systemfit.
> fitsur <-
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
I've been working on a new package and I have a few questions regarding the
behaviour of the nlm function. I've been (for better or worse) using the nlm
function to fit a linear model without suppling the hessian or gradient
attributes in the objective function. I'm curious as to why the nlm requires
31 iterations (for the linear model), and then it doesn't work when I try to
add
2012 Mar 21
1
How to do 2SLS in R
Hi List
I want to carry out structural mode. Following Example l have taken from
Basic Econometrics- Damodar Gujarati :
Advertising intensity function:
Ad/S = a0 + a1M + a2 (CD/S) + a3C + a4C2 + a5Gr + a6Dur – (1)
Concentration function:
C = b0 + b1 (Ad/S) + b2 (MES/S) -(2)
Price-cost margin function:
M = c0 + c1(K/S) + c2Gr + c3C + c4GD + c5(Ad/S) + c6 (MES/S)
2006 May 23
1
problem with ad.test
dear experts,
i am a novice and have been trying to use the anderson-darling test
on a simple text file with one column of data.
i have followed the example in the manual to read from a file into a vector(mm).
i am able to see the summary stats with
>summary(mm)
however, when i try to use the ad.test package, it keeps coming up
with the following error messages,
> ad.test(mm)
Error in
2002 Mar 29
2
Output from examples in help files
I have a large number of troff help files which are automatically converted to .Rd files. Many of these have examples which contain the printed output of the examples. This makes example(functionname) not work. Is there a way to avoid removing all this output by delimiting it in some way such that the output will not appear in R-ex? Secondly, it would be nice if there was a place where output
2018 May 22
1
Question about identifier name mangling in LLVM manual
The Identifiers section in the LLVM language manual states:
"The "\01" prefix can be used on global variables to suppress mangling."
Is this for global variables only, or global values in general, such as functions also? In implementation LLVM seems to have this behavior of suppressing mangling even for functions and aliases.
Thanks,
Gautam
2003 Sep 30
1
can't get names from vector in nlm calls
I've been trying to figure out how to get the names of the parameter vector
variables when inside the function that nlm calls to return the objective
function value:
knls <- function( theta, eqns, data, fitmethod="OLS", instr=NULL, S=NULL )
{
## print( names( theta ) ) # returns NULL
## get the values of the parameters
for( i in 1:length( theta ) )
2003 Oct 06
1
getting names of p vector in nlm function...
Dear R programming folks:
I'm trying to finish off a package for non-linear simultaneous system
estimation and I've been trying to figure out how to get the names of the
parameter vector variables when inside the function that nlm calls to return
the objective function value:
knls <- function( theta, eqns, data, fitmethod="OLS", instr=NULL, S=NULL )
{
## print(
2007 Apr 13
0
Problem with predict in systemfit
A friend of mine sent me below so I am posting below. If it is not
enough information, please just
let me know and I will tell him. Thanks.
-----Original Message-----
Sent: Friday, April 13, 2007 3:58 PM
To: Leeds, Mark (IED)
Subject: R question
I am using the "predict" function after I have done a simultaneous
estimation of a system using "systemfit". fitsur is the output
2004 Apr 16
5
Non-Linear Regression (Cobb-Douglas and C.E.S)
Dear all,
For estimating Cobb-Douglad production Function [ Y = ALPHA * (L^(BETA1)) *
(K^(BETA2)) ], i want to use nls function (without linearizing it). But
how can i get initial values?
------------------------------------
> options(prompt=" R> " )
R> Y <- c(59.6, 63.9, 73.5, 75.6, 77.3, 82.8, 83.6, 84.9, 90.3, 80.5,
73.5, 60.3, 58.2, 64.4, 75.4, 85, 92.7, 85.4,
2007 Apr 05
2
about systemfit
Hello. I am still a newbie in R. Excuse me if I am asking something obvious. My efforts to get an answer through browsing the mailing archives failed. I want to perform an augmented Dickey-Fuller test and to obtain AIC and BIC and to be able to impose some linear restrictions on the ADF regression so as to decide the correct order of autoregression. However I could find no obvious way to impose