similar to: Data structure in R

Displaying 20 results from an estimated 60000 matches similar to: "Data structure in R"

2007 Aug 20
2
how to collapse a list of 1 column matrix to a matrix?
Hi, I encounter a situation where I have a list whose element is a column matrix. Says, $'1' [,1] 1 2 3 $'2' [,1] 4 5 6 Is there fast way to collapse the list into a matrix like a cbind operation in this case? Meaning, the result should be a matrix that looks like: [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 I can loop through all elements and do
2007 Aug 19
1
Question on R server and TinnR
Hi - Classic question that I tried to look up online and couldn't find a clear answer. It seems that I can have R to act as a server. But I never know how this works. Would anyone please provide an example or introduction material where I can learn about this? I'm trying to build an environment where computation are distributed/delegated among different servers requested whenever I need.
2007 Mar 18
2
Lag operator in R does not work
Hi - I'm quite wondering what makes the lag operator does not work for my time series. I have a time series of length about 200000 elements. I would like to have a lag 1 of this time series. I did the following: logprice = log(price, base=exp(1)) # this is my log price which is a vector of price time series of length 200000 ts_logprice = as.ts(logprice, frequency=1) # convert to time series
2007 Jun 02
1
setClass with a slot of RODBC
Hi - I tried to get some answer before but there seems to have no one response. My question is that I have a class like below definition: setClass("DBManager", representation(channel="RODBC")) My purpose of the conn slot is to hold a channel to database connection which is returned by a command like: channel <- odbcConnect("DB", uid="user",
2007 Jun 09
1
How to plot vertical line
Hi,I have a result from polr which I fit a univariate variable (of ordinal data) with probit function. What I would like to do is to overlay the plot of my fitted values with the different intercept for each level in my ordinal data. I can do something like:lines(rep(intercept1, 1000), seq(from=0,to=max(fit),by=max(fit)/1000))where my intercept1 is, for example, the intercept that breaks between
2007 Jun 04
2
How to obtain coefficient standard error from the result of polr?
Hi - I am using polr. I can get a result from polr fit by calling result.plr <- polr(formula, data=mydata, method="probit"); However, from the 'result.plr', how can I access standard error of the estimated coefficients as well as the t statistics for each one of them? What I would like to do ultimately is to see which coefficients are not significant and try to refit the
2007 Aug 13
2
A clean way to initialize class slot of type "numeric" vector
Hi, I have a class definition like this: setClass("foo", representation(members="numeric"), prototype(members=c())) I intend my class to have members, a slot whose value should be a vector of integer. When I initialize this class, I don't have any member yet. So my member is blank. But if I run the above definition into R, it will complain that my slot members is
2007 Jun 27
1
levelplot in lattice
Hi, I'm new to lattice. So please kindly be patient with me. I'm trying to arrange groups of levelplots into 3 rows as follows: Row1: Probabilities as functions of x and y, and conditioned on an event factor vector factor("a","b","c") Row2: Number of days as functions of x and y, and conditioned on, again the same event
2007 Jul 05
2
Question for svm function in e1071
Hi, Sorry that I have many questions today. I am using svm function on about 180,000 points of training set. It takes very long time to run. However, I would like it to spit out something to make sure that the run is not dead in between. Would you please suggest anyway to do so? And is there anyway to speed up the performance of this svm function? Thank you. - adschai
2007 Apr 21
1
Fitting multinomial response in structural equation
Hi - I am confronting a situation where I have a set of structural equation and one or two of my responses are multinomial. I understand that sem would not deal with the unordered response. So I am thinking of the following two ways: 1. Expanding my response to a new set of binary variables corresponding to each label of my multinomial response. Then use each of these as a separate response in my
2007 Apr 09
1
Dealing with large nominal predictor in sem package
Hi, I am using tsls function from sem package to estimate a model which includes large number of data. Among its predictors, it has a nominal data which has about 10 possible values. So I expand this parameter into 9-binary-value predictors with the coefficient of base value equals 0. I also have another continuous predictor. The problem is that, whenever I run the tsls, I will get 'System
2007 May 25
1
Question about setReplaceMethod
Hi I have the code like I show below. The problem here is that I have a setReplacementMethod to set the value of my class slot. However, this function doesn't work when I call it within another function definition (declared by setMethod) of the same class. I do not understand this behavior that much. I'm wondering how to make this work? Any help would be really appreciated. Thank you.
2007 Aug 11
1
R Weka and cobweb
Hi, I never use cobweb before and I'm quite new to this. I have a couple of questions around the cobweb implementation in R Weka. If you could supply answer or insight, I would really appreciate. 1. From Fisher's paper in 1987, it seems that Cobweb only deals with nominal data. In R Weka cobweb, is it allowed to accommodate real/continuous value? 2. My understanding is that Cobweb
2007 Jun 05
1
Question using stepAIC
Hi - I use stepAIC to automatically select the model. The stepAIC was applied on polr as follow:objPolr <- polr(formula=myformula, data=dat, method=METHOD);objPolr.step <- stepAIC(objPolr, trace=T);Then R complaints that it doesn't know about 'dat' when it executes the second line. Below is the exact error that I got when executing the stepAIC line above:Error in eval(expr,
2007 Jun 10
1
Windows vista's early terminate Rgui execution
Hi,I have a frustrating problem from vista that I wonder if anyone has come across the same problem. I wrote a script that involves long computational time (although, during the calculation, it spits out text on the gui to notify me the progress of the calculation periodically). Windows vista always stopped my calculation and claimed that 'Rgui is stop-working. Windows is checking for
2007 Jun 11
1
How do I obtain standard error of each estimated coefficients in polr
Hi, I obtained all the coefficients that I need from polr. However, I'm wondering how I can obtain the standard error of each estimated coefficient? I saved the Hessian and do something like summary(polrObj), I don't see any standard error like when doing regression using lm. Any help would be really appreciated. Thank you! - adschai
2007 Jun 13
1
specify constraints in maximum likelihood
Hi,I know only mle function but it seems that in mle one can only specify the bound of the unknowns forming the likelihood function. But I would like to specify something like, a = 2b or a <= 2b where 'a' and 'b' could be my parameters in the likelihood function. Any help would be really appreciated. Thank you!- adschai [[alternative HTML version deleted]]
2007 Jul 01
1
How to save results from chisq.test or mantelhaen.test to file
Hi, I am new to these functions. I'm wondering if there is anyway to save the entire results (all attributes of the result object) from the chisq.test or mantelhaen.test functions? For example, from chisq.test function, you will have statistic, parameter, p.value, expected, etc. in the result list. How can I save all of them in one shot to, says, a text file or csv file? Thank you. - adschai
2007 Jul 05
1
(Statistics question) - Nonlinear regression and simultaneous equation
Hi,I have a fundamental questions that I'm a bit confused. If any guru from this circle could help me out, I would really appreciate.I have a system of equations in which some of the endogs appear on right hand sides of some equations. To solve this, one needs a technique like 2SLS or FIML to circumvent inconsistency of the estimated coefficients. My question is that if I apply the nonlinear
2007 Nov 15
3
kalman filter estimation
Hi, Following convention below: y(t) = Ax(t)+Bu(t)+eps(t) # observation eq x(t) = Cx(t-1)+Du(t)+eta(t) # state eq I modified the following routine (which I copied from: http://www.stat.pitt.edu/stoffer/tsa2/Rcode/Kall.R) to accommodate u(t), an exogenous input to the system. for (i in 2:N){ xp[[i]]=C%*%xf[[i-1]] Pp[[i]]=C%*%Pf[[i-1]]%*%t(C)+Q siginv=A[[i]]%*%Pp[[i]]%*%t(A[[i]])+R