'Problems with micEconAid in r, Aidsest function error

Hi i am getting this error in my code when trying to estimate the "Almost Ideal Demand System" (AIDS)

"Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': LU computationally singular: ratio of extreme entries in |diag(U)| = 1.815e-29"

Here is my code:

#install.packages("micEconAids")
#install.packages("dplyr")
library(micEconAids)
library(dplyr)


quintile1_shares <- read_excel("quintile 1 shares.xlsx")

Prices <- read_excel("Prices 1.xlsx")

quintile1_VND <- read_excel("quintile 1 VND.xlsx")
quintile1 <- subset(quintile1_VND, select = -`Eating, drinking & smoking`)

nprices <- c(colnames(Prices))
nshares <- c(colnames(quintile1_shares))

df1 <- merge(quintile1, quintile1_shares) %\>%
merge(Prices)

df2 <- as.matrix(df1)
aidsEst(nprices, nshares, "whole country", data =  df1, method = "LA", priceIndex = "S")

my data set has 7 observations and 41 variables that include "prices" and "shares" and "expenditure", i am suspecting that i have to few observations, could this be correct?

Was expecting an output of the aids estimate as shown in this document

https://cran.r-project.org/web/packages/micEconAids/vignettes/micEconAids_vignette.pdf

r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source