problem in WRS2

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

problem in WRS2

greg holly
I got the following error message after running  t2way(y ~ Grup*Time, data
= cp)
  Error in x[[grp[i]]] :
  attempt to select less than one element in get1index

a part of the data is given below. Your help is highly appreciated.

Greg

> head(cp)
  Birey Grup Time         y
1     1    1  Cp1 0.7916386
2     1    1  Cp3 1.7463777
3     1    1  Cp7 1.2008390
4     1    1 Cp14 0.6311380
5     1    1 Cp21 2.1563557
6     1    1 Cp28 1.2008390

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

Bert Gunter-2
This might be impossible to answer without all the data. You might wish to
contact the package maintainer for a question like this.

Cheers,
Bert



On Wed, Nov 6, 2019 at 1:58 PM greg holly <[hidden email]> wrote:

> I got the following error message after running  t2way(y ~ Grup*Time, data
> = cp)
>   Error in x[[grp[i]]] :
>   attempt to select less than one element in get1index
>
> a part of the data is given below. Your help is highly appreciated.
>
> Greg
>
> > head(cp)
>   Birey Grup Time         y
> 1     1    1  Cp1 0.7916386
> 2     1    1  Cp3 1.7463777
> 3     1    1  Cp7 1.2008390
> 4     1    1 Cp14 0.6311380
> 5     1    1 Cp21 2.1563557
> 6     1    1 Cp28 1.2008390
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

Jim Lemon-4
In reply to this post by greg holly
Hi Greg,
I tried this:

cp<-read.table(text="Birey Grup Time y
 1    1  Cp1 0.7916386
 1    1  Cp3 1.7463777
 1    1  Cp7 1.2008390
 1    1 Cp14 0.6311380
 1    1 Cp21 2.1563557
 1    1 Cp28 1.2008390",
 header=TRUE)
library(prettyR)
xtab(Grup~Time,cp)
Crosstabulation of Grup by Time
       Time
Grup     Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
1              1       1       1       1       1       1       6
          16.67   16.67   16.67   16.67   16.67   16.67       -
            100     100     100     100     100     100     100

              1       1       1       1       1       1       6
          16.67   16.67   16.67   16.67   16.67   16.67  100.00

Maybe doing the same on your entire data set will reveal something.

Jim

On Thu, Nov 7, 2019 at 8:58 AM greg holly <[hidden email]> wrote:

>
> I got the following error message after running  t2way(y ~ Grup*Time, data
> = cp)
>   Error in x[[grp[i]]] :
>   attempt to select less than one element in get1index
>
> a part of the data is given below. Your help is highly appreciated.
>
> Greg
>
> > head(cp)
>   Birey Grup Time         y
> 1     1    1  Cp1 0.7916386
> 2     1    1  Cp3 1.7463777
> 3     1    1  Cp7 1.2008390
> 4     1    1 Cp14 0.6311380
> 5     1    1 Cp21 2.1563557
> 6     1    1 Cp28 1.2008390
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

David Winsemius
If a crosstabs on the two factors has any zero counts it might explain.


David

Sent from my iPhone

> On Nov 6, 2019, at 5:42 PM, Jim Lemon <[hidden email]> wrote:
>
> Hi Greg,
> I tried this:
>
> cp<-read.table(text="Birey Grup Time y
> 1    1  Cp1 0.7916386
> 1    1  Cp3 1.7463777
> 1    1  Cp7 1.2008390
> 1    1 Cp14 0.6311380
> 1    1 Cp21 2.1563557
> 1    1 Cp28 1.2008390",
> header=TRUE)
> library(prettyR)
> xtab(Grup~Time,cp)
> Crosstabulation of Grup by Time
>       Time
> Grup     Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
> 1              1       1       1       1       1       1       6
>          16.67   16.67   16.67   16.67   16.67   16.67       -
>            100     100     100     100     100     100     100
>
>              1       1       1       1       1       1       6
>          16.67   16.67   16.67   16.67   16.67   16.67  100.00
>
> Maybe doing the same on your entire data set will reveal something.
>
> Jim
>
>> On Thu, Nov 7, 2019 at 8:58 AM greg holly <[hidden email]> wrote:
>>
>> I got the following error message after running  t2way(y ~ Grup*Time, data
>> = cp)
>>  Error in x[[grp[i]]] :
>>  attempt to select less than one element in get1index
>>
>> a part of the data is given below. Your help is highly appreciated.
>>
>> Greg
>>
>>> head(cp)
>>  Birey Grup Time         y
>> 1     1    1  Cp1 0.7916386
>> 2     1    1  Cp3 1.7463777
>> 3     1    1  Cp7 1.2008390
>> 4     1    1 Cp14 0.6311380
>> 5     1    1 Cp21 2.1563557
>> 6     1    1 Cp28 1.2008390
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] 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, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

greg holly
Hi David, Jim and Bert;

Thanks so much. Your responses are much appreciated. Here is the results
when I create a cross-tabulation from xtab(Grup~Time,cp) for the whole
data. It seems to me there is no problem. I am wondering why still I
have the
 Error in x[[grp[i]]] :
  attempt to select less than one element in get1index

ERROR when I am running the t2way(y ~ Grup*Time, data = cp)  using WRS2
package. Yours advice are highly appreciated.

Kind regards,
Greg


        Time
Grup     Cp0      Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
1             25      25      25      25      25      25      25     175
           14.29   14.29   14.29   14.29   14.29   14.29   14.29       -
            62.5    62.5    62.5    62.5    62.5    62.5    62.5    62.5

2             15      15      15      15      15      15      15     105
           14.29   14.29   14.29   14.29   14.29   14.29   14.29       -
            37.5    37.5    37.5    37.5    37.5    37.5    37.5    37.5

              40      40      40      40      40      40      40     280
           14.29   14.29   14.29   14.29   14.29   14.29   14.29  100.00





On Wed, Nov 6, 2019 at 7:46 PM David Winsemius <[hidden email]>
wrote:

> If a crosstabs on the two factors has any zero counts it might explain.
>
> —
> David
>
> Sent from my iPhone
>
> > On Nov 6, 2019, at 5:42 PM, Jim Lemon <[hidden email]> wrote:
> >
> > Hi Greg,
> > I tried this:
> >
> > cp<-read.table(text="Birey Grup Time y
> > 1    1  Cp1 0.7916386
> > 1    1  Cp3 1.7463777
> > 1    1  Cp7 1.2008390
> > 1    1 Cp14 0.6311380
> > 1    1 Cp21 2.1563557
> > 1    1 Cp28 1.2008390",
> > header=TRUE)
> > library(prettyR)
> > xtab(Grup~Time,cp)
> > Crosstabulation of Grup by Time
> >       Time
> > Grup     Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
> > 1              1       1       1       1       1       1       6
> >          16.67   16.67   16.67   16.67   16.67   16.67       -
> >            100     100     100     100     100     100     100
> >
> >              1       1       1       1       1       1       6
> >          16.67   16.67   16.67   16.67   16.67   16.67  100.00
> >
> > Maybe doing the same on your entire data set will reveal something.
> >
> > Jim
> >
> >> On Thu, Nov 7, 2019 at 8:58 AM greg holly <[hidden email]> wrote:
> >>
> >> I got the following error message after running  t2way(y ~ Grup*Time,
> data
> >> = cp)
> >>  Error in x[[grp[i]]] :
> >>  attempt to select less than one element in get1index
> >>
> >> a part of the data is given below. Your help is highly appreciated.
> >>
> >> Greg
> >>
> >>> head(cp)
> >>  Birey Grup Time         y
> >> 1     1    1  Cp1 0.7916386
> >> 2     1    1  Cp3 1.7463777
> >> 3     1    1  Cp7 1.2008390
> >> 4     1    1 Cp14 0.6311380
> >> 5     1    1 Cp21 2.1563557
> >> 6     1    1 Cp28 1.2008390
> >>
> >>        [[alternative HTML version deleted]]
> >>
> >> ______________________________________________
> >> [hidden email] 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, minimal, self-contained, reproducible code.
> >
> > ______________________________________________
> > [hidden email] 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, minimal, self-contained, reproducible code.
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

Bert Gunter-2
As I said previously, you probably should contact the maintainer. But a
(wild??) guess might be that robust/resistant procedures -- which is what
you are using -- can downweight data values to 0 weight, effectively
removing them.This might lead to effectively empty cells in a cross
tabulation that would then yield your error, despite the crosstab on raw
data showing all cells with data.

Again, note my weasel words ("might","could", etc.), so the above could be
complete nonsense. Which is why I suggested you contact the maintainer.

-- Bert

On Thu, Nov 7, 2019 at 7:50 AM greg holly <[hidden email]> wrote:

> Hi David, Jim and Bert;
>
> Thanks so much. Your responses are much appreciated. Here is the results
> when I create a cross-tabulation from xtab(Grup~Time,cp) for the whole
> data. It seems to me there is no problem. I am wondering why still I
> have the
>  Error in x[[grp[i]]] :
>   attempt to select less than one element in get1index
>
> ERROR when I am running the t2way(y ~ Grup*Time, data = cp)  using WRS2
> package. Yours advice are highly appreciated.
>
> Kind regards,
> Greg
>
>
>         Time
> Grup     Cp0      Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
> 1             25      25      25      25      25      25      25     175
>            14.29   14.29   14.29   14.29   14.29   14.29   14.29       -
>             62.5    62.5    62.5    62.5    62.5    62.5    62.5    62.5
>
> 2             15      15      15      15      15      15      15     105
>            14.29   14.29   14.29   14.29   14.29   14.29   14.29       -
>             37.5    37.5    37.5    37.5    37.5    37.5    37.5    37.5
>
>               40      40      40      40      40      40      40     280
>            14.29   14.29   14.29   14.29   14.29   14.29   14.29  100.00
>
>
>
>
>
> On Wed, Nov 6, 2019 at 7:46 PM David Winsemius <[hidden email]>
> wrote:
>
> > If a crosstabs on the two factors has any zero counts it might explain.
> >
> > —
> > David
> >
> > Sent from my iPhone
> >
> > > On Nov 6, 2019, at 5:42 PM, Jim Lemon <[hidden email]> wrote:
> > >
> > > Hi Greg,
> > > I tried this:
> > >
> > > cp<-read.table(text="Birey Grup Time y
> > > 1    1  Cp1 0.7916386
> > > 1    1  Cp3 1.7463777
> > > 1    1  Cp7 1.2008390
> > > 1    1 Cp14 0.6311380
> > > 1    1 Cp21 2.1563557
> > > 1    1 Cp28 1.2008390",
> > > header=TRUE)
> > > library(prettyR)
> > > xtab(Grup~Time,cp)
> > > Crosstabulation of Grup by Time
> > >       Time
> > > Grup     Cp1      Cp14     Cp21     Cp28     Cp3      Cp7
> > > 1              1       1       1       1       1       1       6
> > >          16.67   16.67   16.67   16.67   16.67   16.67       -
> > >            100     100     100     100     100     100     100
> > >
> > >              1       1       1       1       1       1       6
> > >          16.67   16.67   16.67   16.67   16.67   16.67  100.00
> > >
> > > Maybe doing the same on your entire data set will reveal something.
> > >
> > > Jim
> > >
> > >> On Thu, Nov 7, 2019 at 8:58 AM greg holly <[hidden email]>
> wrote:
> > >>
> > >> I got the following error message after running  t2way(y ~ Grup*Time,
> > data
> > >> = cp)
> > >>  Error in x[[grp[i]]] :
> > >>  attempt to select less than one element in get1index
> > >>
> > >> a part of the data is given below. Your help is highly appreciated.
> > >>
> > >> Greg
> > >>
> > >>> head(cp)
> > >>  Birey Grup Time         y
> > >> 1     1    1  Cp1 0.7916386
> > >> 2     1    1  Cp3 1.7463777
> > >> 3     1    1  Cp7 1.2008390
> > >> 4     1    1 Cp14 0.6311380
> > >> 5     1    1 Cp21 2.1563557
> > >> 6     1    1 Cp28 1.2008390
> > >>
> > >>        [[alternative HTML version deleted]]
> > >>
> > >> ______________________________________________
> > >> [hidden email] 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, minimal, self-contained, reproducible code.
> > >
> > > ______________________________________________
> > > [hidden email] 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, minimal, self-contained, reproducible code.
> >
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

R help mailing list-2
In reply to this post by greg holly
You can get this error if one of the explanatory variables is not a
factor.  E.g.
> WRS2::t2way(y ~ x1 * x2, data =
expand.grid(y=11:12,x1=letters[11:13],x2=21:24))
Error in x[[grp[i]]] :
  attempt to select less than one element in get1index

The immediate cause is that t2way uses 1:p instead of seq_len(p) when p may
be zero, but I suspect that the code should be converting some things to
factors so p cannot be zero.  Take this up with the package's maintainer.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Wed, Nov 6, 2019 at 1:58 PM greg holly <[hidden email]> wrote:

> I got the following error message after running  t2way(y ~ Grup*Time, data
> = cp)
>   Error in x[[grp[i]]] :
>   attempt to select less than one element in get1index
>
> a part of the data is given below. Your help is highly appreciated.
>
> Greg
>
> > head(cp)
>   Birey Grup Time         y
> 1     1    1  Cp1 0.7916386
> 2     1    1  Cp3 1.7463777
> 3     1    1  Cp7 1.2008390
> 4     1    1 Cp14 0.6311380
> 5     1    1 Cp21 2.1563557
> 6     1    1 Cp28 1.2008390
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: problem in WRS2

greg holly
Thanks, William. After converting Grup into the factor, I got the results.
Thanks, everyone to spend time to give their help.

Regards,
Greg

On Thu, Nov 7, 2019 at 12:02 PM William Dunlap <[hidden email]> wrote:

> You can get this error if one of the explanatory variables is not a
> factor.  E.g.
> > WRS2::t2way(y ~ x1 * x2, data =
> expand.grid(y=11:12,x1=letters[11:13],x2=21:24))
> Error in x[[grp[i]]] :
>   attempt to select less than one element in get1index
>
> The immediate cause is that t2way uses 1:p instead of seq_len(p) when p
> may be zero, but I suspect that the code should be converting some things
> to factors so p cannot be zero.  Take this up with the package's maintainer.
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Wed, Nov 6, 2019 at 1:58 PM greg holly <[hidden email]> wrote:
>
>> I got the following error message after running  t2way(y ~ Grup*Time, data
>> = cp)
>>   Error in x[[grp[i]]] :
>>   attempt to select less than one element in get1index
>>
>> a part of the data is given below. Your help is highly appreciated.
>>
>> Greg
>>
>> > head(cp)
>>   Birey Grup Time         y
>> 1     1    1  Cp1 0.7916386
>> 2     1    1  Cp3 1.7463777
>> 3     1    1  Cp7 1.2008390
>> 4     1    1 Cp14 0.6311380
>> 5     1    1 Cp21 2.1563557
>> 6     1    1 Cp28 1.2008390
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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, minimal, self-contained, reproducible code.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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, minimal, self-contained, reproducible code.