Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:45:34+00:00 2026-06-01T23:45:34+00:00

My dataset comprises two observations of a numeric score (Participation) each at beginning and

  • 0

My dataset comprises two observations of a numeric score (“Participation”) each at beginning and end of treatment for 70 individuals. The times are not constant between individuals but visual inspection of these shows the large majority rise over the period

sfa <- read.csv("SFAFinalData.csv", header = TRUE)
groupingFormula <- as.formula(paste(columnName,"~ TIME|ID")) 
dataSubset <- na.omit(sfa[,seq(1:6)])
inputData <- groupedData(groupingFormula, data=dataSubset, labels = list("Weeks post injury", columnName))
m1 <- lme(inputData)

Works as expected

> m1
Linear mixed-effects model fit by REML
Data: inputData 
Log-restricted-likelihood: -631.7963
Fixed: Participation ~ TIME 
(Intercept)        TIME 
18.7616485   0.4220891 

Random effects:
Formula: ~TIME | ID
Structure: General positive-definite
        StdDev     Corr  
(Intercept) 15.4985010 (Intr)
TIME         0.2192035 1     
Residual    13.2272350       

Number of Observations: 140
Number of Groups: 70 

I’m now trying to compare the analysis (i.e. participation as a function of time) in each of three subgroups (“TYPE”: factor with three levels with 10, 29 and 31 individuals respectively) but

m2 <- update(m1, fixed = .~.*TYPE)

leads to an error

Warning message:
In lme.formula(fixed = Participation ~ TYPE, data = inputData) :
Fewer observations than random effects in all level 1 groups

Struggling to see what I’m doing wrong here: as far as I can see I have enough observations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:45:36+00:00Added an answer on June 1, 2026 at 11:45 pm

    Try not to use groupedData. I know, the examples in the book use it very often, but I find it the most confusing part of lme. And avoid . in formulae, it can be very greedy might lead to the type of error messages.

    With a lot of guessing (please at least post str(sfa)), I assume you want something like:

    sfa <- read.csv("SFAFinalData.csv", header = TRUE)
    # No grouped Data!
    lme(Participation~TIME*TYPE,random=~1|ID,data=sfa)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a dataset, each element has an associated score. eg: Banana -
I have a data set comprised of 5 minute price observations (not an xts
My dataset contains two tables i need to get division of FirstTable.Row2/SecondTable.Row5
How do I pass a dataset object to a stored procedure? The dataset comprises
My dataset currently has 12 rows of data. Each representing data for a month.
I am working on a large dataset which comprises travel behaviour data over a
My dataset is not exactly like EAV format, but it's somewhat similar; here's the
I have a dataset (where each data is a vector of attributes with their
Using a dataset w , which includes a numeric column PY , I can
Dataset extends ArrayList. Dataset<Pair<SRGB>> data = new Dataset<Pair<SRGB>>(); Statement stmt = this.conn.createStatement(); ResultSet rs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.