An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051201/845b1fef/attachment.pl
masked from package:base?
12 messages · August Berg, Arne Henningsen, Uwe Ligges
On Friday 02 December 2005 02:50, August Berg wrote:
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?
This means that the command "library( systemfit )" is not executed when the package is checked by "R CMD check". @Jeff: I think we should remove "library( systemfit )" from the example section, because everybody should know this.
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 ) data( kmenta ) attach( kmenta )
The following object(s) are masked from package:base :
q
The data set "kmenta" has a (column) name called "q" R> names(kmenta) [1] "q" "p" "d" "f" "a" If you attach these data to the search path, there are two objects with the name "q": the quantity from Kmenta's data set and the function to quit R. Hence, attaching this data set masks the function "q" (quit) from the package called "base". However, you don't have to worry, because "q()" and "?q" still work as expected. @Jeff: Since using "attach" is often troublesome, I suggest that we remove "attach( kmenta )" from the example section and use "systemfit( ..., data = kmenta )" instead. Best wishes, Arne
[[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051202/973f18b1/attachment.pl
On Friday 02 December 2005 09:00, you wrote:
On 12/1/05, Arne Henningsen <ahenningsen at email.uni-kiel.de> wrote:
On Friday 02 December 2005 02:50, August Berg wrote:
I am confused by the following description in
html what does the "Not run" mean?
This means that the command "library( systemfit )" is not executed when the package is checked by "R CMD check". @Jeff: I think we should remove "library( systemfit )" from the example section, because everybody should know this.
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 ) data( kmenta ) attach( kmenta )
The following object(s) are masked from package:base :
q
The data set "kmenta" has a (column) name called "q" R> names(kmenta) [1] "q" "p" "d" "f" "a" If you attach these data to the search path, there are two objects with the name "q": the quantity from Kmenta's data set and the function to quit R. Hence, attaching this data set masks the function "q" (quit) from the package called "base". However, you don't have to worry, because "q()" and "?q" still work as expected. @Jeff: Since using "attach" is often troublesome, I suggest that we remove "attach( kmenta )" from the example section and use "systemfit( ..., data = kmenta )" instead. Best wishes, Arne
Thanks. But still report such an error:
pval <- 1 - pchisq( h, dim( fit3sls$bcov )[1] )
Error in pchisq(q, df, lower.tail, log.p) :
Non-numeric argument to mathematical function
The object "h" is not numeric, but a list: R> class(h) [1] "hausman.systemfit" R> names(h) [1] "q" "qVar" "m" "df" "pval" You probably want this: R> pval <- 1 - pchisq( h$m, dim( fit3sls$bcov )[1] ) Or you can just type R> h 2.53565 (P-value: 0.924389) This is documented in the systemfit manual, please type R> ?hausman.systemfit Best wishes, Arne
Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051202/88464939/attachment.pl
On Friday 02 December 2005 09:58, you wrote:
On 12/2/05, Arne Henningsen <ahenningsen at email.uni-kiel.de> wrote:
On Friday 02 December 2005 09:00, you wrote:
On 12/1/05, Arne Henningsen <ahenningsen at email.uni-kiel.de> wrote:
On Friday 02 December 2005 02:50, August Berg wrote:
I am confused by the following description in
t .
html what does the "Not run" mean?
This means that the command "library( systemfit )" is not executed
when
the package is checked by "R CMD check". @Jeff: I think we should remove "library( systemfit )" from the
example
section, because everybody should know this.
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 ) data( kmenta ) attach( kmenta )
The following object(s) are masked from package:base :
q
The data set "kmenta" has a (column) name called "q" R> names(kmenta) [1] "q" "p" "d" "f" "a" If you attach these data to the search path, there are two objects
with
the name "q": the quantity from Kmenta's data set and the function to quit
R.
Hence, attaching this data set masks the function "q" (quit) from the package called "base". However, you don't have to worry, because "q()" and
"?q"
still work as expected. @Jeff: Since using "attach" is often troublesome, I suggest that we remove "attach( kmenta )" from the example section and use "systemfit( ..., data = kmenta )" instead. Best wishes, Arne
Thanks. But still report such an error:
pval <- 1 - pchisq( h, dim( fit3sls$bcov )[1] )
Error in pchisq(q, df, lower.tail, log.p) :
Non-numeric argument to mathematical function
The object "h" is not numeric, but a list: R> class(h) [1] "hausman.systemfit" R> names(h) [1] "q" "qVar" "m" "df" "pval" You probably want this: R> pval <- 1 - pchisq( h$m, dim( fit3sls$bcov )[1] ) Or you can just type R> h 2.53565 (P-value: 0.924389) This is documented in the systemfit manual, please type R> ?hausman.systemfit Best wishes, Arne -- Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
I see. I guess there is a typo in http://www.maths.lth.se/help/R/.R/library/systemfit/html/hausman.systemfit on that webpage, pval <- 1 - pchisq( h, dim( fit3sls$bcov )[1] )
Nope, this is the documentation to an old version of systemfit.
Also, is there any way to open the data in atable(I apologize this is not a question spefific for the Hausman test).
Which data? kmenta? What do you mean with "open"? R> edit( kmenta ) or: R> write.csv( kmenta, "kmenta.csv" ) open the file "kmenta.csv" with a spreadsheet application. Best wishes, Arne
Best Regards, August
Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051202/57d2d6f1/attachment.pl
On Friday 02 December 2005 10:21, August Berg wrote:
On 12/1/05, Arne Henningsen <ahenningsen at email.uni-kiel.de> wrote:
On Friday 02 December 2005 02:50, August Berg wrote:
I am confused by the following description in
html what does the "Not run" mean?
This means that the command "library( systemfit )" is not executed when the package is checked by "R CMD check". @Jeff: I think we should remove "library( systemfit )" from the example section, because everybody should know this.
I am new to R and what does [checked by "R CMD check"] mean?
The source of an R package can be checked by the command "R CMD check <package_name>" (on a Unix/Linux machines; on Windows machines this is slightly different). Further information is available in the manual "Writing R Extensions".
Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 ahenningsen at agric-econ.uni-kiel.de http://www.uni-kiel.de/agrarpol/ahenningsen/
Arne Henningsen wrote:
On Friday 02 December 2005 10:21, August Berg wrote:
On 12/1/05, Arne Henningsen <ahenningsen at email.uni-kiel.de> wrote:
On Friday 02 December 2005 02:50, August Berg wrote:
I am confused by the following description in
html what does the "Not run" mean?
This means that the command "library( systemfit )" is not executed when the package is checked by "R CMD check". @Jeff: I think we should remove "library( systemfit )" from the example section, because everybody should know this.
I am new to R and what does [checked by "R CMD check"] mean?
The source of an R package can be checked by the command "R CMD check <package_name>" (on a Unix/Linux machines; on Windows machines this is slightly different).
In fact, it is exactly the same command on Windows. Uwe Ligges
Further information is available in the manual "Writing R Extensions".
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051202/bbc10fd8/attachment.pl
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051202/1ead283c/attachment.pl
August Berg wrote:
The source of an R package can be checked by the command "R CMD check <package_name>" (on a Unix/Linux machines; on Windows machines this is slightly
different). In fact, it is exactly the same command on Windows. Uwe Ligges
Why it did not work for me?
library( systemfit ) R CMD check systemfit
Please read the R Installation and Administration manual. You are supposed to check from the OS shell, not from within R. Additionally, you have to do it on the package sources and you will need the relevant tools and compiler. Anyway, the checks have already been performed for you on recent versions of R and systemfit. See: http://cran.r-project.org/bin/windows/contrib/checkSummaryWin.html Uwe Ligges
Error: syntax error in "R CMD"
R CMD check <systemfit>
Error: syntax error in "R CMD"