Displaying 20 results from an estimated 700 matches similar to: "t(xmat)"
2005 Jul 07
3
xmat[1, 2:3] <- NULL
I have a situation where I'm filling out a dataframe
from a database. Sometimes the database query doesn't
get anything, so I end up trying to place NULL in the
dataframe like below.
> temp <- NULL
> xmat <- as.data.frame(matrix(NA, 2, 3))
> xmat[1, 2:3] <- temp
Error in if (m < n * p && (n * p)%%m)
stop(gettextf("replacement has %d items, need %d",
2002 Nov 09
2
importing data from Excel using RODBC
Hi,
I used RODBC to import data from an Excel spreadsheet "*.xls", but some
columns were returned as zeros. When I looked at these columns in Excel, I
found that thery are results of formula calculations and not entry. My
question is: Is there any parameter or command I need to use in order to
overcome this problem?
Thank you
Ahmad Abu Hammour
2008 Aug 18
2
matrix row product and cumulative product
I spent a lot of time searching and came up empty handed on the
following query. Is there an equivalent to rowSums that does product or
cumulative product and avoids use of apply or looping? I found a rowProd
in a package but it was a convenience function for apply. As part of a
likelihood calculation called from optim, I?m computing products and
cumulative products of rows of matrices with
2002 Apr 19
4
Durbin-Watson test in packages "car" and "lmtest"
Hi,
P-values in Durbin-Watson test obtained through the use of functions available in packages "lmtest" and "car" are different. The difference is quite significant. function "dwtest" in "lmtest" is much faster than "burbinwatson" in "car". Actually, you can take a nap while the latter trying to calculated Durbin-Watson test. My question
1999 Nov 07
2
arima0() (PR#314)
Full_Name: Ahmad Abu Hammour
Version: rw0651
OS: windows 95
Submission from: (NULL) (63.23.128.44)
Although I know that "ts package" is preliminary, I wanted to compare the
results from R and SPSS. I ran ARIMA(2,1,2) in both softwares. I got NaN in
standard errors of coefficients from R and real figures from SPSS. I changed
"delta" in R to match that used by SPSS, I received
2002 Sep 09
1
impulse response function
Hi,
Is there a function in any of R-packages that can produce and plot the
impulse response function for any model..
Thank you
Ahmad Abu Hammour
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body",
2004 Sep 16
1
Newbie q. need some help understanding this code.
dear all.
Would someone be kind and willing to explain the code
below for a person who has never used R? ( that is if
one has enough time and inclination)
It implements gillepsie's stochastic algorithm for
Lotka Volterra model.
What would help me tremendously is to see the
breakdown of the line by line code into plain english.
thanks for any insights or other comments.
sean
2002 Nov 16
1
using the function "expression" with "paste" in a plot
Hi,
I noticed that paste and expression in the following manner does not produce
the desired result.
vnames=c("pi","y","delta")
vx=vn=3
m=16
# mydata any matrix that takes for the following form
mydata=array(somedata,c(m,vn,vx))
# producing plots
for (j in 1:vx){
for (i in 1:vn)
{
plot(mydata, type="l", main=expression(paste("Effect of",
2005 Jul 22
1
find confounder in covariates
Hi,
I was wondering if there is a way, or function in R to
find confounders. For istance,
> a = sample( c(1:3), size=10,replace=T)
> X1 = factor( c('A','B','C')[a] )
> X2 = factor( c('Aa','Bb','Cc')[a] )
> Xmat = data.frame(X1,X2,rnorm(10),rnorm(10))
> dimnames(Xmat)[[2]] = c('z1','z2','z3','y')
Now,
2009 Mar 05
3
methods package
I'm working on the next version of coxme, one step of which is converting
the bdsmatrix library from Splus to R. Actually, it is a conversion from
S4 methods as first described in the Green book to S4 methods as they
currently exist. Mostly it's going ok, but not entirely.
1. The biggest issue is lack of documentation. The online help pages have
not been a help; they keep saying
2004 Mar 03
1
match.call(), S4
I get different results from match.call(), according to whether a function
is dispatched via S3 or S4. Specifically, when I use S4 dispatch in the
following example, the match.call() result is of length 1 less than I
expect. I need to add an extra comma to get the same results as in the S3
method.
--------example
setClass("foo",representation("matrix"))
2007 Apr 13
3
apply problem
Dear R-Help
I am running apply on a data.frame containing factors and numeric
columns. It appears to convert are columns into as.character? Does it
convert data.frame into matrix? Is this expected? I wish it to recognise
numerical columns and round numbers. Can I use another function instead
of apply, or should I use a for loop in the case?
> summary(xmat)
A B
2012 Oct 27
2
Class generator functions for reference classes
As of rev. 61035 in r-devel, setRefClass() now returns a generator
function, as setClass() has done since 2.15.0.
The convenient style is now:
mEdit <- setRefClass("mEdit",......)
xx <- mEdit(data = xMat)
instead of
xx <- mEdit$new(data = xMat)
The returned object still has fields and methods accessible as before.
See the "Value" and "Reference Class
2002 Apr 26
1
optim or nlm with matrices
Hi,
I have the following hypothetical optimization problem:
-det(t(x-A%*%x1)%*%(x-A%*%x1))
where A,x,x1 are matrices. A coefficients and x and x1 are variable matrices or vectors.
I tried to apply optim and nlm functions but I kept receive the following massage:
Error in A%*%x1 : non-conformable arguments.
The massage appears even the -det() can be calculated and the dimensions are checked.
here
2025 Jan 14
1
Need help with time series
For below data, I find strange results in basic time series analysis. Why does acf() function find missing values? When crossprod(xmat) is invertible, why does arima() find system exactly singular?
Thanks,
Naresh
x <- c(24957, 10577, -18516, 2940, -1458, 32704, -26697, -46902, 48413, -11937, 2043, 26431, -55336, -16838, 89651, 25363, -50388, -41012, -28242, -18213, 58759, -15290, -7413,
2004 Sep 28
3
sapply behavior
Hi,
I use sapply very frequently, but I have recently noticed a behavior of
sapply which I don't understand and have never seen before. Basically,
sapply returns what looks like a matrix, says it a matrix, and appears to
let me do matrix things (like transpose). But it is also a list and behaves
like a list when I subset it, not a vector (so I can't sort a row for
instance). I
2000 Sep 20
1
lag() and lm()
Hi,
I am using R interactively for estimation and even data manipulation. I want
to use lag() function within lm() function in a way looks like:
mymodel<- lm(y~x+I(lag(y,-1)-1, data=anydata)
What I get is always perfect fit; (that is, coefficient=1) which is not
true.
If the model looks like
mymodel<- lm(y~z+x+I(lag(x,-1)-1, data=anydata)
summary returns only one coefficient for x and
2025 Jan 14
1
Need help with time series
acf wants a time series, so tries to make one:
as.ts(myts)
Time Series:
Start = 19357
End = 20027
Frequency = 1
[1] 24957 NA NA NA NA NA NA NA NA NA
[11] NA NA NA NA NA NA NA NA NA NA
[21] NA NA NA NA NA NA NA NA NA NA
[31] NA 10577 NA NA NA NA NA
2002 Apr 09
2
Restricted Least Squares
Hi,
I need help regarding estimating a linear model where restrictions are imposed on the coefficients. An example is as follows:
Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t
restriction
a1+ a2 =1
Is there a function or a package that can estimate the coefficient of a model like this? I want to estimate the coefficients rather than test them.
Thank you for your help
Ahmad Abu Hammour
--------------
2005 May 20
1
using src/Makevars file
Hi all,
Thanks to all who offered advice on using F95 in R.
Now I'm trying to compile a test package using gfortran, Linux 2.4.21 and
R 2.1.0.
I was able to successfully compile and use a test F95 routine by setting my
environment variables as follows in bash:
export PATH=~/bin/:$PATH
export F77=gfortran
export LD_LIBRARY_PATH=~/bin/irun/lib
export GFORTRAN_STDIN_UNIT=-1
Now I'm