[R] mgp and axis title positions

2011-10-16 Thread Benjamin Cheah
Hi all,
I consider myself a somewhat experienced user of R, but have struggled with 
this for a while now. to the point where I just end up pulling the entire graph 
together in powerpoint and fixing it up from there.
How does one adjust the horizontal/vertical positions of axis titles? I've 
tried using mgp in the par function, but that never produces anything 
satisfactory as x and y-axes are modified simultaneously. It would appear that 
you can specify mgp in the axis function, but that doesn't seem to work at all.
It is particularly frustrating when you need to adjust axis title positions 
separately for x and y axes - i.e. specify mgp twice - once for each axis 
within the axis function. But this doesn't seem to work - is this a bug?
Cheers,
Ben
[[alternative HTML version deleted]]

__
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] Problem with specifying variance-covariance matrix for random effects (nlme package)

2010-02-14 Thread Benjamin Cheah
Hi all,

I've been struggling with trying to specify a diagnoal matrix for linear mixed 
effects model. I think I've got nearly everything correct, except the following 
message appears:

In lme.formula(fixed = fwave ~ sex + sexXbulbar + visit + age +  :
  Fewer observations than random effects in all level 1 groups

Not sure if i've provided enough details, but I'm basically trying to perform a 
mixed effects model analysis, controlling for several covariates. Incorporating 
random effects for the intercept and slope.

What does the second line, 'Fewer observations than random effects in all level 
1 groups' mean?

Many thanks in advance,

Ben Cheah



  
__
[[elided Yahoo spam]]

[[alternative HTML version deleted]]

__
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] Functional data analysis - problem with functional linear regression

2010-01-24 Thread Benjamin Cheah
Hi all,

I'm trying to perform a functional linear regression with functional response 
(comprising 14 coordinates) and 4 scalar covariates. 

When I create a list containing the scalar covariates (with 14 replications 
each), I keep getting the following message:

[1] "Vector in XFDLIST[[ 1 ]] has wrong length."
[1] "Matrix in XFDLIST[[ 1 ]] has more than one column."
[1] "Vector in XFDLIST[[ 2 ]] has wrong length."
[1] "Matrix in XFDLIST[[ 2 ]] has more than one column."
[1] "Vector in XFDLIST[[ 3 ]] has wrong length."
[1] "Matrix in XFDLIST[[ 3 ]] has more than one column."
[1] "Vector in XFDLIST[[ 4 ]] has wrong length."
[1] "Matrix in XFDLIST[[ 4 ]] has more than one column."
Error in fRegress.fdPar(PPIfdPar, predictor, betalist) : 
  problem with xfdlist

So in contrast to what is advised in the R FDA manual, I reduce my scalar 
covariate matrices to column vectors with 88 rows (for 88 indepedent 
observations), each. This message pops up:

[1] "Vector in XFDLIST[[ 1 ]] has wrong length."
[1] "Vector in XFDLIST[[ 2 ]] has wrong length."
[1] "Vector in XFDLIST[[ 3 ]] has wrong length."
[1] "Vector in XFDLIST[[ 4 ]] has wrong length."
Error in fRegress.fdPar(PPIfdPar, predictor, betalist) : 
  problem with xfdlist

Can anyone offer any solutions?

Many thanks in advance!

Ben Cheah



  
__
See what's on at the movies in your area. Find out now: 
http://au.movies.yahoo.com/session-times/
[[alternative HTML version deleted]]

__
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] Functional data analysis - problems with smoothing

2009-10-23 Thread Benjamin Cheah
Hi Peter and Spencer (and everyone else out there),

Thank you for your prompt reply to my post re. FDA - FYI - i'm very new to R 
and FDA. Currently half way through a biostats masters degree in Sydney, 
Australia! Absolutely loving it and I hope to include R computing on my future 
CV!

Just to clarify things:

When I entered what you suggested, this is what I obtained with my own 
dataset
> str(isi)
 num [1:14] 1 1.5 2 2.5 3 3.5 4 5 7 10 ...

Similarly, for Jim Ramsay's dataset (chapter five of Use R book):
> str(age)
 num [1:31] 1 1.25 1.5 1.75 2 3 4 5 6 7 ...

Doesn't this mean that my data object, 'isi' is numeric?

Also, I was looking through Jim Ramsay's datasets - I'm fairly sure that my 
vector, 'isi' was similarly organised to his vector, 'age' in chapter 5 of his 
new Use R FDA book, so I'm fairly certain that the data is numeric but it 
obviously isn't

Hope this email clarified things - apologies if it hasn't - still very new to 
the terminology and overall feel of R.

The R user network is terrific! Thank you for caring!

Ben





From: Peter Ehlers 

Cc: R-help@r-project.org
Sent: Fri, 23 October, 2009 5:07:15 PM
Subject: Re: [R] Functional data analysis - problems with smoothing

The error message is pretty clear: regardless of what
*you* think, R says that 'isi' is not numeric.

Are you sure that 'isi' is not a *factor* object?
I'm willing to bet that it is.

Use str() to check your data.

-Peter Ehlers

Benjamin Cheah wrote:
> Hi all,
> 
> I'm having major issues with smoothing my functional data
> 
> I'm referring to Jim Ramsay's
> examples in his books. The following error message keeps appearing,
> despite all my data being numeric can anyone kindly offer any suggestions?
> 
> isi - vector of argument values - i.e. the independent variable of the curves
> rlz - data array
> TMSfdPar - functional data parameter.
> 
>> TMSfdPar = fdPar(TMSbasis, 4, 0.01)
>> TMSfdsmooth = smooth.basis(isi, rlz, TMSfdPar)
> Error in smooth.basis(isi, rlz, TMSfdPar) : 'argvals' is not numeric.
> 
> I don't understand why the error message keeps popping up. I've tried playing 
> around with Jim Ramsay's datasets and I think my data is organised in a 
> similar manner to his, so can't understand what's going on oh, the 
> frustration!
> 
> Thanks in advance,
> 
> Ben
> (the amateur R data analyst and statistician.)
> 
> 
> 
>   
> __
> 
> 
> [[alternative HTML version deleted]]
> 
> __
> 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.
> 
> 



  
__


[[alternative HTML version deleted]]

__
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] Functional data analysis - problems with smoothing

2009-10-22 Thread Benjamin Cheah
Hi all,

I'm having major issues with smoothing my functional data

I'm referring to Jim Ramsay's
examples in his books. The following error message keeps appearing,
despite all my data being numeric can anyone kindly offer any suggestions?

isi - vector of argument values - i.e. the independent variable of the curves
rlz - data array
TMSfdPar - functional data parameter.

> TMSfdPar = fdPar(TMSbasis, 4, 0.01)
> TMSfdsmooth = smooth.basis(isi, rlz, TMSfdPar)
Error in smooth.basis(isi, rlz, TMSfdPar) : 'argvals' is not numeric.

I don't understand why the error message keeps popping up. I've tried playing 
around with Jim Ramsay's datasets and I think my data is organised in a similar 
manner to his, so can't understand what's going on oh, the frustration!

Thanks in advance,

Ben
(the amateur R data analyst and statistician.)



  
__


[[alternative HTML version deleted]]

__
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.