[R] Single pdf of all R vignettes request

2022-10-30 Thread Sun, John
Dear All, I am writing to ask whether there exists a single pdf of all the vignettes from R packages. This would be good resource. Best regards, John __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/l

[R] How to simulate data where the covariate has large non-zero covariance with the residual and fourth moments of regressors may not exist?

2022-09-28 Thread Sun, John
Dear All, I am writing to ask how to simulate data where the covariate has a large-non-zero covariance with the model residual and/or the regressors do not have finite fourth moments for regression analysis. I want to do some empirical monte-carlo simulations for continuous dependent variable

[R] How to obtain a consistent estimator with a binary response model with endogenous explanatory variables?

2022-09-28 Thread Sun, John
Dear All, I stumbled on a Wikipedia page describing the Two stage least-squares with a probit model with implementing a consistent estimator in binary variable regression. How do I implement this method in R? It is related to instrumental variables estimator. I looked in ivreg and plm package a

[R] How to find the variance-covariance matrix of a random-vector using R

2022-09-20 Thread Sun, John
Dear All, Reposting as plain text rather than html. I realized that R does not support finding the variance-covariance matrix of a random-vector. It must take two arguments. Numpy's cov doesn't give sensible results. I ask in a bigger context of finding the variance-covariance matrix of the ve

Re: [R] Query

2021-04-26 Thread Sun Yong Kim
vars package From: John Kane Sent: Sunday, April 25, 2021 12:30 PM To: Sun Yong Kim Cc: r-help@r-project.org Subject: Re: [R] Query What package has the irf function? On Fri, 23 Apr 2021 at 09:34, Sun Yong Kim wrote: > > Hi > > I have been trying

[R] Query

2021-04-23 Thread Sun Yong Kim
Hi I have been trying to circulate a question but my question keeps getting rejected. Let me try again via email. The message is below: I am trying to change the tick size for IRF graphs that I created using the following code below: par(mfrow=c(2,3)) IRF_F2 <- irf(SVARmod1, impulse="deltaw2",

[R] [help]Format excel spreadsheet using R?

2019-11-07 Thread Baojun Sun
I have a Excel spreadsheet with two kinds of elements: these include non-integers and integers. I want to select all numbers with decimal points i.e. 3.1415 (non-integers). I don't want to highlight cells that are whole numbers like 314. How do I do this custom selection? My goal is to make all non

Re: [R] Can't rsync extsoft/3.6 when compiling R 3.6

2019-05-05 Thread Shuguang Sun
Jeroen Ooms writes: Now I can build R 3.6 in my Windows 10 box. Thanks. > On Thu, May 2, 2019 at 9:36 AM Martin Maechler > wrote: >> >> >>>>> Shuguang Sun >> >>>>> on Thu, 2 May 2019 12:57:37 +0800 writes: >> >> > H

[R] Can't rsync extsoft/3.6 when compiling R 3.6

2019-05-01 Thread Shuguang Sun
indows/extsoft/3.6/ . ) receiving incremental file list rsync: change_dir "/bin/windows/extsoft/3.6" (in CRAN) failed: No such file or directory (2) --8<---cut here---end--->8--- There is no "windows/extsoft/3.6/" and only up to

[R] (no subject)

2018-07-30 Thread Baojun Sun
The book "Introduction to Statistical Learning" gives R scripts for its labs. I found a script for ridge regression that works on the dataset the book uses but is unusable on other datasets I own unless I clean the data. I'm trying to understand the syntax for I need for data cleaning and am stuc

[R] ts.intersect() not working

2015-11-01 Thread Sun, Changyou
Hi all, I am trying to combine a single time series with a multivariate ts using ts.intersect(). However, depending on the month, the function may or may not work. Is this a bug or something I missed? Thank you for the help. Edwin Sun = > # Example 1: work well > a2 <

[R] Embed fonts in an R graph

2015-07-10 Thread Edwin Sun
Hello all, I cannot embed a common font type into an R graph. I did it successfully in December 2014 with the previous R version. However, with R 3.2.1 in July 2015, the following sample codes do not work anymore. pdf(file = "c:/testA.pdf", family = "serif") plot(x = 1:10, y = rnorm(10)) dev.off(

Re: [R] Warning message when starting RStudio

2015-04-24 Thread Sun Shine
On 23/04/15 13:41, Albin Blaschka wrote: Hello Am 23.04.2015 um 09:57 schrieb Berend Hasselman: On 23-04-2015, at 08:45, Sun Shine wrote: Hi list Recently, when starting up RStudio, the following warning is being displayed: "Error in tools:::httpdPort <= 0L : comparison (4) is

[R] Warning message when starting RStudio

2015-04-22 Thread Sun Shine
oduce this message. Does anyone have an idea on how to clear the conditions that are giving rise to this warning? Many thanks Sun __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Removing words and initials with tm

2015-04-10 Thread Sun Shine
Hi Jim The name's come up on my radar, but that's about it. I'll look into it. Thanks for the reference. All the best S On 10/04/15 23:36, Jim Lemon wrote: > Hi Sun, > No, I was thinking of something like hunspell, which seems to fit into > the sort of work tha

[R] Cluster analysis using term frequencies

2015-03-24 Thread Sun Shine
smart (efficient/ elegant) way of checking the occurrence and frequency value of the terms that may be associated with 'sports', 'learning', and 'extra-mural' and extracting these into a matrix or data frame so that I can analyse and plot their clustering to see if

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-03 Thread Sun Shine
her does it seem to work when the whole list is enclosed within quotes (e.g. "all, the, text"). While not critical to have the capacity to read in an externally generated list, it sure would be helpful. Thanks. Sun On 02/03/15 07:36, Sun Shine wrote: Thanks Jim. I thought that I

Re: [R] Using a text file as a removeWord dictionary in tm_map

2015-03-01 Thread Sun Shine
anks again. Regards, Sun On 01/03/15 21:13, jim holtman wrote: The 'read.table' was creating a data.frame (not a vector) and applying 'c' to it converted it to a list. You should alway look at the object you are creating. You probably want to use 'scan'. ==

[R] Using a text file as a removeWord dictionary in tm_map

2015-02-28 Thread Sun Shine
ction in tm, I do: > docs <- tm_map(docs, removeWords, stopDict) which has no effect. Neither does: > docs <- tm_map(docs, removeWords, c(stopDict)) What am I not seeing/ doing? How do I pass a text file with pre-defined terms to the removeWords

[R] Rgraphviz and NA indices error

2015-02-26 Thread Sun Shine
get an error: Error in `[.simple_triplet_matrix`(m, , terms) : NA indices not allowed. I have not been successful in finding out why this error persists nor what to do about it. Anyone have any ideas to progress past this issue? Thanks Sun __ R-help@r-project

[R] Solved: Re: text miner error: Error in UseMethod("meta", x)

2015-02-26 Thread Sun Shine
e the above line earlier in the preparation stage. If anyone has more informed insight, please share. Cheers Sun On 25/02/15 17:33, Sun Shine wrote: Hi list I've been working my way through a tutorial on text mining ( http://onepager.togaware.com/TextMiningO.pdf ) and all was well unti

[R] text miner error: Error in UseMethod("meta", x)

2015-02-25 Thread Sun Shine
atest tm (v 0.6) and claimed that the earlier tolower step was wrong. However, my code used the recommended: corpus <- tm_map(corpus, content_transformer(tolower)) Is there anyone on the list who could either sign-post me to a solution or assist in debugging this ple

Re: [R] Noob question re: writing while loops on one line

2015-02-15 Thread Sun Shine
Thanks John: understanding it as a line return makes sense! Cheers Sun On 15/02/15 14:59, John Kane wrote: Hi Sun, Can you check the code in the one line command in RStudio? I tied it and got the expected error. Or to put it another way, it should not have run for you :) The semi-colon

Re: [R] Noob question re: writing while loops on one line

2015-02-15 Thread Sun Shine
? Thanks again Sun On 15/02/15 10:41, Jim Lemon wrote: Hi Sun, Try including a semicolon. while(count < 10) { print(count); count<-count+1 } Jim On Sun, Feb 15, 2015 at 9:20 PM, Sun Shine wrote: Hi list I'm working through some exercises and did a while loop which raised an issue

[R] Noob question re: writing while loops on one line

2015-02-15 Thread Sun Shine
ine however gives this error: "Error: unexpected symbol in "while(count < 10) { print(count) count"" My question: How can one write out a while loop all in one line? Is there a symbol or something that I should be including? Thanks for any suggestions. Sun ___

Re: [R] Updating to R 3.1.1. - impacts on existing packages

2015-02-03 Thread Sun Shine
Thanks Jeff/ Henrik Jeff - that's what I needed: so far the update seems to be painless. Many thanks Sun On 03/02/15 01:45, Jeff Newmiller wrote: I think you missed the question, Henrik, which was directed at updating the local 3.1 library with all of the packages that were in th

[R] Updating to R 3.1.1. - impacts on existing packages

2015-02-02 Thread Sun Shine
ading. Thanks for any steers Sun __ 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://www.R-project.org/posting-guide.html and provide commented,

Re: [R] Working with data frames

2014-12-11 Thread Sun Shine
ndamentally sound and something I will need to get my head around. For now though, I think I'll stick to exploring ggplot2 so that I can visualise this data set more easily. Thanks again. Best Sun On 11/12/14 16:06, William Dunlap wrote: > Here is a reproducible example > > d

[R] Working with data frames

2014-12-11 Thread Sun Shine
e x-axis instead of the numbers? Thanks for any help. Cheers Sun __ 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://www.R-project.org/posting-guide.htm

Re: [R] analyzing qualitative data sets

2014-07-29 Thread Sun Shine
(650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Tue, Jul 29, 2014 at 6:01 AM, Sun Shine wrote: Hello list I'm just beginning my PhD and am likely to be using lots of surveys in my data collection,

Re: [R] analyzing qualitative data sets

2014-07-29 Thread Sun Shine
ot;) library(HH) ?likert Rich On Tue, Jul 29, 2014 at 9:01 AM, Sun Shine wrote: Hello list I'm just beginning my PhD and am likely to be using lots of surveys in my data collection, and am wanting to get my head around the ideas about how best to approach the tasks in R. The data sets I have

[R] analyzing qualitative data sets

2014-07-29 Thread Sun Shine
Hello list I'm just beginning my PhD and am likely to be using lots of surveys in my data collection, and am wanting to get my head around the ideas about how best to approach the tasks in R. The data sets I have collected so far for some preliminary practise with are made up of the followin

Re: [R] [Re: Does a survival probability(the probability not, experiencing an event) have to be non-increasing?

2014-03-21 Thread Zhiyuan Sun
Thanks Terry. Your explanation is right on the point. You solved my question about time-dependent covariate. When calculating survival at time t, you have to consider the exposure history before ant at time t. It is reasonable when we assume cumulative hazard before time t can be carried over to

[R] Does a survival probability(the probability not experiencing an event) have to be non-increasing?

2014-03-19 Thread Zhiyuan Sun
My question is related to a cox model with time-dependent variable. When I think about it more, I get a little confused about non-increasing assumption for survival probability for an individual. For example, for a time-dependent ,say x, assuming increasing x increases the risk of event. Assume,tim

[R] How to use restricted cubic spline in survfit.cph function in "survival" package?

2014-03-06 Thread Zhiyuan Sun
Hello, I used PBC data set included in the "survival" package to fit a cox model. The model included a restricted cubic spline transformation on age. Then I tried using "survfit" function to predict a survival curve using the first row of the original data. I got an error message. The R code and e

Re: [R] Translating a basic Python script into R

2013-12-29 Thread sun shine
On 29/12/13 10:45, YuHong wrote: In my opinion, the best usages of Python and R should be for different type of tasks respectively. For example, Python is good for automating miscellaneous tasks, while R is good for list data processing and statistical modelling. Therefore when you become m

Re: [R] Translating a basic Python script into R

2013-12-29 Thread sun shine
iven me a lot of ideas to play around with in experimenting, so I can envisage an enjoyable afternoon testing some of this on the other models Meadows described. Many thanks for your clear explanations. Best wishes Sun __ R-help@r-project.org mail

[R] Translating a basic Python script into R

2013-12-28 Thread sun shine
translate the Python script into R so that I can then run a plot as well? Many thanks in anticipation. Sun __ 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, reproducible code.

[R] SNPRelate package error

2013-01-22 Thread sun-ye
has different numbers of columns. Best regrads -- Dr. Ye SUN Key Laboratory of Plant Resources Conservation and Sustainable Utilization South China Botanical Garden, Chinese Academy of Sciences Xingke Road 723,Tianhe District, Guangzhou 510650, PR Chi

[R] BRugs has a bug to use "OpenBUGS_PATH"

2012-09-21 Thread Shuguang Sun
inition of findOpenBUGS. In line 38 "version.inst <- NA" should be "version.full <- NA". Otherwise, version.full can not be found if I set the environment variable "OpenBUGS_PATH". Thank you all. Shuguang Sun __ R-help@r

[R] undefined S4 class in parallel computing at snowfall

2012-06-28 Thread Edwin Sun
Dear All, I have a question of how to export S4 class specification to clusters/workers in parallel computing. The package I used is snowfall. The problem is reproducible as follows. Any hint is greatly appreciated. Edwin Sun === begin === library(snowfall) sfInit(parallel = TRUE, cpus

Re: [R] p-value for the fitted parameters in linear models

2012-06-24 Thread Li SUN
Dear All, Thanks for all your explanations and sorry for the confusion. I will need to consult some statistician for help. Sincerely, Li Sun 2012/6/24 S Ellison : > > >>> But what if x is exact while y has some uncertainty Δy, in the >>> relation y = k * x + b? >&

Re: [R] p-value for the fitted parameters in linear models

2012-06-24 Thread Li SUN
2012/6/24 Uwe Ligges : > > > On 24.06.2012 20:35, Li SUN wrote: >> >> Thanks David and Brian. >> >> But what if x is exact while y has some uncertainty Δy, in the >> relation y = k * x + b? >> >> Now I need to fit some data like >> x      

Re: [R] p-value for the fitted parameters in linear models

2012-06-24 Thread Li SUN
Δy to lm() so that I can find k, b as well as their uncertainties Δk, Δb? Li Sun 2012/6/24 Prof Brian Ripley : > On 24/06/2012 18:39, David Winsemius wrote: >> >> >> On Jun 24, 2012, at 1:21 PM, Li SUN wrote: >> >>> Sorry for the confusion. >>>

Re: [R] p-value for the fitted parameters in linear models

2012-06-24 Thread Li SUN
length associated with it. Is it possible to pass Δx to the linear model lm(), and from the output to find the uncertainty Δk for k, Δb for b as well? Li Sun 2012/6/24 Uwe Ligges : > > > On 24.06.2012 17:47, Li SUN wrote: >> >> Hi All, >> >> when using the linear mod

[R] p-value for the fitted parameters in linear models

2012-06-24 Thread Li SUN
Hi All, when using the linear model lm() to fit data of the form y = k * x + b, is it possible to know the p-value for the parameters k and b? i.e. can we find the result of the form (k, Δk; b, Δb)? Thanks in advance! Li Sun __ R-help@r-project.org

[R] multivariate xts merge question

2012-04-27 Thread Soo Sun Park
Hi, I have an xts starting with a number of columns (currency pairs see below), then I add new ones which are derived from existing ones (like adding the moving average of a column) by merging the new columns one by one. These get the name of the column they are calculated from concatenated with "

Re: [R] Huge difference btw system time and elapsed time

2012-02-22 Thread Libo Sun
thz.ch> wrote: > >>>>> "LS" == Libo Sun > >>>>> on Tue, 21 Feb 2012 21:09:54 -0700 writes: > >> Thanks. Shall I sum the user time and system time, which >> roughly equals to the elapsed time? > > No. Rather just us

Re: [R] Huge difference btw system time and elapsed time

2012-02-21 Thread Libo Sun
ks > like there might be value in trying to squeeze some speed out of your > script. A simple thing like byte-compiling that gives 2x speedup would > be huge here. > > Michael > > On Tue, Feb 21, 2012 at 10:06 PM, Libo Sun > wrote: > > Hi all, > > > > I got thi

[R] Huge difference btw system time and elapsed time

2012-02-21 Thread Libo Sun
Hi all, I got this time for my code, > proc.time()-pt user systemelapsed 132541.743 0.004 132533.526 As you can see, there is huge difference btw elapsed time and system time. Does that mean lots of I/O? Or some bad coding? Thanks, Libo [[alternative HTML version del

Re: [R] About source()

2012-01-04 Thread Li SUN
Thanks, guys! I am using Rscript at the moment and will definitely try littler. Li Sun 2012/1/4 Rainer M Krug : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 04/01/12 10:39, Uwe Ligges wrote: >> >> >> On 03.01.2012 21:22, Li SUN wrote: &g

Re: [R] About source()

2012-01-03 Thread Li SUN
Thanks, Rolf, Justin and Uwe! Actually I wanted to run .R file as a script, just like what people do for bash scripts or python scripts. It seems to me that adding "#!/usr/bin/R -f" at the first line is what I need. Is this true? Li Sun 2012/1/2 Rolf Turner : > On 03/01/12 17:02,

[R] About source()

2012-01-02 Thread Li SUN
directory, otherwise it has to be specified in full path. So is there any mechanism(such as environment variable) to specify an additional directory of .R files that source() could search in? Thanks in advance! Li Sun Department of Physics University of California, San Diego

Re: [R] strange problem with strptime and date variable

2011-07-18 Thread Edwin Sun
David - Thanks very much. That is a great hint. I believe that is the solution. Edwin Sun -- View this message in context: http://r.789695.n4.nabble.com/strange-problem-with-strptime-and-date-variable-tp3677178p3677205.html Sent from the R help mailing list archive at Nabble.com

[R] strange problem with strptime and date variable

2011-07-18 Thread Edwin Sun
Hello all, I am manipulating a large database with 70,000 records. "strptime" generates a date variable but R treats some of the values as NA. I attach a simple example below. I have spent hours on this problem. Any hint would be greatly appreciated. Many thanks, Edwin Sun # =

[R] Piecewise distribution function estimation with Generalized Pareto for tail

2011-07-06 Thread Edwin Sun
Thank you, Edwin Sun -- View this message in context: http://r.789695.n4.nabble.com/Piecewise-distribution-function-estimation-with-Generalized-Pareto-for-tail-tp3649961p3649961.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-p

[R] how could I use function in-visible to user in my code?

2011-05-23 Thread Shuguang Sun
Dear R user, How could I use function in-visible to user in my code? For example 'survfitKM' or 'survfit.formula' in package survival. These functions are in-visible to user. Thanks, Shuguang __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] Could I use R function lm or nlm in C code?

2011-04-23 Thread Shuguang Sun
for your advice. Shuguang Sun Fudan University __ 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, reproducible code.

Re: [R] how to update my own function

2010-11-23 Thread Edwin Sun
Thank you all the reply. The use of sys.call() as suggested by Ducan works pretty well. This is good as the outputs from my function are large. The use of apply family functions as suggested by Erik is good for small amounts of outputs. Edwin Sun -- View this message in context: http://r

[R] how to update my own function

2010-11-23 Thread Edwin Sun
Hello all, I wrote a function with many arguments. Then I need to call it many times with changes on some arguments only. Is there any way to write a function or have a method to "update" it, like the relationship between lm() and update()? Many thanks, Edwin Sun T

[R] Color Alaska in USA map

2010-11-19 Thread Xin Sun
"USA", "Hawaii"), fill=TRUE) ,scales=list(draw=FALSE), colramp = colorRampPalette(c("white", "black")),xlab=NULL) After I run this code, the continental USA could be colored, but alaska is not colored. I have tried to write alas

Re: [R] dnorm and qnorm

2010-11-14 Thread Edwin Sun
Thank you all for the great help. I think the optimize function and approach solves my problem well. Edwin Sun -- View this message in context: http://r.789695.n4.nabble.com/dnorm-and-qnorm-tp3040427p3041962.html Sent from the R help mailing list archive at Nabble.com

[R] dnorm and qnorm

2010-11-12 Thread Edwin Sun
Hello all, I have a question about basic statistics. Given a PDF value of 0.328161, how can I find out the value of -0.625 in R? It is like reversing the dnorm function but I do not know how to do it in R. > pdf.xb <- dnorm(-0.625) > pdf.xb [1] 0.328161 > qnorm(pdf.xb) [1] -0.444997 > pno

[R] contour on a simplex

2010-10-22 Thread Yunting Sun
Hello, anyone knows if there is a way in R to draw contour on a simplex based on a function f(x,y,z) with domain (x+y+z = 1)? Thank you! gigi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

[R] question about masking

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can't function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind regard

[R] question about masked object

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can't function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind regard

[R] question about masked object

2010-10-20 Thread Yunting Sun
Hello, I encounter the problem that one library I use masks the function gam in another library I use so that the gam in the other library can’t function correctly. Is it possible to damask? I detach one of the library but the masking problem is still there. Thank you and kind regards, g

[R] instal tar.gz package on windows, help

2010-10-05 Thread wenyue sun
*Dear All, * ** *I want to install a tar.gz package in R on a windows operating system. Since R in Windows accepts only packages in zip file for installation, I tried to decompress the tar.gz file and create a zip file using 7 zip for a subsequent installation, yet this didn't work. Can anyone hel

[R] r-help@r-project.org

2010-10-05 Thread wenyue sun
*Dear All, * ** *I want to install tar.gz in R on a Windows operating system. I know that R in Win accepts packages in zip file for installation. Therefore, I**tried to decompress the tar.gz file and create a zip file using 7zip but the installation of the resulting zip files didn't work. Can an

[R] For help on Open .tar.gz file in R under Windows

2010-10-04 Thread wenyue sun
Hey All, I am new in R. Need help on code that can open the .tar.gz file in R under Windows. Can any one help. Thanks in Advance. Wayne [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] Get distribution of positive/negative examples for each cluster

2010-07-21 Thread Boya Sun
Dear R experts, I have a labeled data set. Each data is assigned a binary label 0 or 1. Assume that I use some clustering algorithm to group the data by clusters (using some features of the data). Now I want to know how many data are labeled as 0/1 in each cluster. For example, assume that I have

Re: [R] ggplot2: How to change font of labels in geom_text

2010-07-12 Thread Edwin Sun
I have the same problem and I wonder if there is any answer from the community. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-How-to-change-font-of-labels-in-geom-text-tp991579p2286671.html Sent from the R help mailing list archive at Nabble.com. ___

[R] How to get rid of extra areas on spatial data map

2010-04-16 Thread Changyou Sun
Hello All, I am using "sp" and "maps" libraries to have a map for some fire data. The region covered is Mississippi State in the US. Then I would like to add a layer of ecoregion on the top (omenrik layer from nationalatlas.gov). The problem is that the ecoregion layer is larger than the state bou

Re: [R] GARCH estimation with exogenous variables in the mean equation

2010-04-09 Thread Edwin Sun
Hello, I have the similar issue in estimating a GARCH model with exogenous variables in the mean equation. Currently, to my understanding, the garch function in tseries package can handle univariate model, and garchFit in fGarch can handle ARMA specification. I wonder if there is any R function

[R] garch estimation with exogenouse variables

2010-04-09 Thread Changyou Sun
Hello All, I need to estimate a GARCH model. The mean equation contains exogenous variables like Y = B * X + et. I understand the garch function in tseries package can handle univariate model, and garchFit in fGarch can handle ARMA specification. Is there any function that can handle exogenous var

[R] replace id by running number

2010-03-27 Thread sun
Dear all, I want to replace an (unsorted) id variable in a large dataset by a running number without changing the order of the cases. E.g., y <- c(4,4,4,2,45,12,12) should be replaced by something like x <- c(1,1,1,2,3,4,4) Sorry for this simple question & thank you very much for your help!

[R] Package ismev, gpd.fit, and interpretation for statistics of extreme values

2010-01-31 Thread Changyou Sun
tion is related to calculating return levels. There are multiple fires on individual calendar days. Each year there are 2000 to 5000 fires. I am not sure how to specify the number of observations per year, i.e., the value of "npy" and which formulas should be used. Thank you for your h

Re: [R] navigation panel with help

2010-01-28 Thread Changyou Sun
Duncan, Thank you for your quick reply. Do we users have any options to change that? I personally become addicted to the navigation panel and feel it is kind of table of contents. Regards, Edwin Sun -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Thursday

[R] navigation panel with help

2010-01-28 Thread Edwin Sun
notice there is an index link at the bottom of the page. By the way, I did not make any change on my browser. Is this a change for this version? Thank you for your help. Edwin Sun -- View this message in context: http://n4.nabble.com/navigation-panel-with-help-tp1395663p1395663.html Sent from the R

[R] Duration model with sample selection (or selectivity)

2009-12-16 Thread Changyou Sun
Hello All, I am interested in estimating a duration model (also known as survival analysis or event-history analysis). I use an economic dataset. In economics terms, the model is "duration model with sample selection (or selectivity)." The time spell variable is only observed for a sample that mee

Re: [R] ggplot legend for multiple time series

2009-12-01 Thread Edwin Sun
Hello - Thank you so much for the help. It works perfectly. I guess that as many have pointed out, ggplot is a great package but there is a lack of documentation and examples. Edwin Sun baptiste auguie-5 wrote: > > Hi, > > I don't understand why you used scale_manual_colour

[R] ggplot legend for multiple time series

2009-12-01 Thread Edwin Sun
<- data.frame(year=1875:1972, level=LakeHuron) ggplot(huron, aes(year)) + geom_line(aes(y=level+5, colour="above")) + geom_line(aes(y=level-5, colour="below")) + scale_colour_manual("Direction", c("above"="black", "below"="black&

[R] ggplot legend for multiple time series

2009-12-01 Thread Changyou Sun
<- data.frame(year=1875:1972, level=LakeHuron) ggplot(huron, aes(year)) + geom_line(aes(y=level+5, colour="above")) + geom_line(aes(y=level-5, colour="below")) + scale_colour_manual("Direction", c("above"="black", "below&

[R] nlmeode question

2009-06-17 Thread In-sun Nam Knutsson
Dear All, I like to use nlmeode but so far having a trouble with setting up a function part. It does not allow me to use Cliver etc in the DiffEq and it does not allow me to have Vabs in the ObsEq. Would you kindly let me know what to do? Best wishes, In-Sun FunODE <- list( DiffEq=l

[R] [R Question]: regarding exponential axis

2009-03-02 Thread Sun, Larry
Hi there, How to plot exponential axis (i.e. equally spaced .1, 1, 10, 100..)? I want to use it with xyplot; it would be great if there is a detailed example. Thanks a lot! Larry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

[R] Sweave

2008-11-18 Thread Yiguo Sun
Dear All, I have both R 2.80 and Scientific Workplace 5.5 installed on my computer. I copied the following commands from HTML help provided by R: testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") Sweave(testfile) I then compile Sweave-test-1.tex file using Scientific Wo

Re: [R] How to generate a new factor variable by two other factor variables

2008-11-04 Thread Shuguang Sun
") >> } >> )) >> levels(mydata$factorC)<-list("0"="00", "1"="10", "2"="01","3"="11") >> mydata >> >> # Option 2 >> # You'll need to read the data again to see how

[R] How to generate a new factor variable by two other factor variables

2008-11-04 Thread Shuguang Sun
factorC factorA factorB 0 0 0 0 0 0 1 1 0 2 0 1 3 1 1 -- Shuguang Sun Fudan University, China __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] help needed for HWE.exact in library "genetics"

2008-08-21 Thread Sun, Ying [BSD] - HGD
Hi, I have a genotype data for both case and controls and would like to calculate the HW p-value. However, since the number of one genotype is 0, I got wired result. Would someone help me to figure it out? Or confirm it's right? Thanks a lot. > library( "genetics" ) NOTE: THIS

[R] how to use chisq.test with 2 row matrix having 0 in it?

2008-08-21 Thread Sun, Ying [BSD] - HGD
Hi, I am working on calculating X^2 for some matrix (most of them have either two rows or 2 columns) by using chisq.test in R. However when there are 0s in the matrix, chisq.test does not work. For example: > elements <- matrix( c( 0, 0, 9, 5, 71, 168), nr = 2 ) > element

Re: [R] NLME questions -- interpretation of results

2008-07-02 Thread Jenny Sun
1.14, lrc = -0.18)) >> fm2 <- update(fm1, random = pdDiag(Asym + R0 ~ 1)) >> fm3 <- update(fm2, random = pdDiag(Asym+R0+lrc~ 1)) >Error in nlme.formula(model = Y ~ SSlogis(X, Asym, R0, lrc), data = LAST, : > Step halving factor reduced below minimum in PNLS step > >

[R] NLME questions -- interpretation of results

2008-07-02 Thread Jenny Sun
My special thanks to Chunhao Tu for the suggestions about testing significance of two locations. I used logistic models to describe relationships between Y and X at two locations (A & B). And within each location, I have four groups (N,E,S,W)representing directions. So the test data can be arra

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
[EMAIL PROTECTED] wrote: > At a guess ... > >> erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE) >> erfcinv <- function(x) qnorm(x/2, lower = FALSE)/sqrt(2) >> erfc(0.3) > [1] 0.6713732 >> erfcinv(erfc(0.3)) > [1] 0.3 > > It may not hurt to include these wrappers in R for matlab refugees.

Re: [R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
Peter Dalgaard wrote: > sun wrote: >> I am converting some matlab code into R that use inverse of the >> complementary error function, erfcinv and did not find an equivalent in >> R, is there such a function in some contributed modules? >> >> > Basically,

[R] R equivalent of erfcinv in matlab

2008-04-13 Thread sun
I am converting some matlab code into R that use inverse of the complementary error function, erfcinv and did not find an equivalent in R, is there such a function in some contributed modules? Thanks. __ R-help@r-project.org mailing list https://stat.

Re: [R] R CMD SHLIB errors

2008-03-19 Thread sun
oops, forgive me for the typo. "Benilton Carvalho" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-pro

Re: [R] R CMD SHLIB errors

2008-03-19 Thread sun
error disappeared after I installed gcc4 and the default settings from RTools works well now. Have a nice day! Sun "Prof Brian Ripley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Using 'mingw32-make' indicates that you have not followed the inst

[R] R CMD SHLIB errors

2008-03-19 Thread sun
installed other softwares, so I am a bit confusing at this moment what would be the cause of this problem. Could some please give some suggestions? Thanks in advance. Sun __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] .jinit()

2008-03-11 Thread Michael Sun
Dear list, when I write .jinit(), the following error message coming out. Error occurred during initialization of VM Could not reserve enough space for object heap Error in .jinit() : Cannot create Java virtual machine (-4) I have C:\Program Files\Java\jre1.6.0_04 and C:\Program Files\Java\jre1.

Re: [R] regex sulotion for seperating number and string

2008-03-05 Thread sun
gt;> x.sep <- gsub("([[:digit:]]+)[ ,]*([[:alpha:]]+)", "\\1 \\2", x) >> # now create separate values >> strsplit(x.sep, " ") > [[1]] > [1] "2564" "gc" > > [[2]] > [1] "2367" "GH" > > [[3]] &

  1   2   >