Displaying 4 results from an estimated 4 matches for "newx1".
Did you mean:
newx
1999 Jun 07
1
data.frame
...moothing splines, with syntax similar to lm and glm. In a formula
say y~x1*x2, x1 or x2 or both can be multivariate. The corresponding
predict function also has syntax similar to that of lm. To prepare
newdata to be used in predict(object,newdata,...), I can use
> newdata <- data.frame(x1=newx1,x2=newx2)
only for univariate x1 and x2. For multivariate predictors, I have to
fake it by using
> newdata <- model.frame(~x1+x2,list(x1=newx1,x2=newx2))
Chong Gu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwi...
2008 Oct 22
0
newbie Syntax questions: Re-Calculating expansion factors
...ook
something like this:
TargetX1Sums <- ##{read an external file of totals for tripid_nu/lineon,
How should I format the data?? Dataframe or matrix??}##
TargetX2Sums <- xtabs(~tripid_nu, data= TargetX1Sums)
InitX1Sums <- xtabs(~tripid_nu+lineon, data=SurveyData)
SurveyData$NewX1= ##{some formulation of TargetX1Sums/InitX1Sums,
selecting by tripid_nu/lineon }##
InitX2Sums <- xtabs(NewX1~tripid_nu, data=SurveyData)
SurveyData$NewX2= ##{some formulation of TargetX2Sums/InitX2Sums
selecting by tripid_nu }##
Am I thinking of this correctly? What data structur...
2008 Nov 05
1
How do I read a text (.csv) file to match a matrix/cross tab? (Object confusion??)
...ot;structure" for both?
Question 2) Why do the labels in NewTargetData have dots in place of
spaces? Will that be a problem later when I try to match them with
SurveyData?
Question 3) Ultimately, I want to create a variable in the original
dataframe like:
SurveyData$NewX1 = TargetX1Sums/ CurrentX1Sums { for each
tripid_nu, lineon combination}
Am I on the right track to do so? Any hints on what THAT syntax will
look like?
Thanks in advance,
########################################################################
########################...
2008 Oct 30
1
Trying to "expand" some data - Newbie needs help
...Sums (and NewTargetX2Sums) to print in column form.
How do I make it do so? t(CurrentX2Sums) doesn't seem to do the trick.
How do I avoid getting e.g. "De.Soto" when I read "De Soto" into
NewTargetData?
How do I put this back into my dataframe?
SurveyData$NewX1 = NewTargetX1Sums/CurrentX1Sums but how do I
specify (tripid_nu lineon) the indices?
If I'm only a ?LookHere or ??LookThere away I'd appreciate being pointed
in the right direction.
Thanks in advance.
All the gory details:
> sessionInfo() #...